<jupyter_start><jupyter_text>Testing Balanced Not-Random Network<jupyter_code>import tensorflow as tf
import numpy as np
degree=20
netsize=1000
k=2
interface_dim=350
density=degree/netsize
randomnetwork=np.zeros((netsize,netsize))
for row in range(netsize):
    if (row%3==0): 
        for i in range(degree):
            randomnetwork[row,row-i]=-1
    else:
        for i in range(degree):
            randomnetwork[row,row-i]=1/2
randomnetwork<jupyter_output><empty_output><jupyter_text>One shock in time<jupyter_code>interface=np.zeros(interface_dim)
for i in range(interface_dim):
    r=tf.random.uniform(shape=[],minval=0,maxval=1)
    interface[i]=r
interface
time=10
#Initialized!
temp=np.zeros((time,netsize))
for i in range(interface_dim):
   temp[0,i]=interface[i]

#update fire states
for t in range(time):
    if t<time-1:
        for i in range(netsize):
            
            s= np.dot(temp[t],randomnetwork[i])*1/12 #forget_rate=1/12
            if s>0:
                 temp[t+1,i]=s
            else:
                 temp[t+1,i]=0
y=np.zeros(netsize)
for t in range(time):
    plt.scatter(y,temp[t])
    y=y+0.01
for i in range(time):
    print(max(temp[i])*100)
max(temp[8])
x=[-1, 2, 3, -4]
abs(x[1])
print(tf.nn.relu6([1,2, 10]))<jupyter_output>tf.Tensor([1 2 6], shape=(3,), dtype=int32)<jupyter_text>Stability in Long Period of Time and Multiple Shocks...<jupyter_code>time=100
#Initialized!
temp=np.zeros((time,netsize))
for i in range(interface_dim):
   temp[0,i]=interface[i]

#update fire states

temp2=np.zeros(netsize)
for t in range(time):
    if t<time-1:
        interface=np.zeros(interface_dim)
        for i in range(interface_dim):
            r=tf.random.uniform(shape=[],minval=0,maxval=1)
            interface[i]=r
                
        for i in range(interface_dim):
            temp2[i]=temp[t,i]+interface[i]
            
        for i in range(netsize):
            s=np.dot(temp2,randomnetwork[i])*1/12 #forget_rate=1/12
            if s>0:
                temp[t+1,i]=s
            else:
                temp[t+1,i]=0
        
        #changing size
        for i in range(interface_dim):
            interface[i]=temp[t+1,i]

y=np.zeros(netsize)
for t in range(time):
    plt.scatter(y,temp[t])
    y=y+0.01
np.max(temp[8:40])
for i in range(8):
    a=a+(3.3*1/4)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1474222411589263, 'fraction_numerical': 0.036642522368981675, 'mean_word_length': 2.9133333333333336, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '265461', 'license': 'MIT', 'n_tokens_mistral': 922, 'n_tokens_neox': 892, 'n_words': 166, 'path': 'Codes/2 Method/2-3 Testing other Networks/2-3-2 Ballanced but nonrandom/Generalized first-order binding/Testing Balanced Not-Random Network.ipynb', 'repo_name': 'adismmhonoredk/Working-Memory-for-Online-Memory-Binding-Tasks-A-Hybrid-Model', 'size': '2347'}