def lesion_esn_behavior(complements, network, training_data, ground_truth):
"""
This function lesions nodes and tracks their contributions to the output signal. This is for the classic MSA part.
"""
if len(complements) == len(network.W):
return 0 # every node in the network is lesioned so toss a zero to your MSA oh valley of plenty.
lesioned_network = deepcopy(network)
for target in complements: # same as above
lesioned_network.W[target] = 0.00001
lesioned_network.W_fb[target] = 0.00001
lesioned_network.W_in[target] = 0.00001
lesioned_network.fit(X=None, y=training_data)
y_pred = lesioned_network.predict() # contrary to the previous function, here we want the output signal.
return float(np.linalg.norm(y_pred,2))
I want to use float number to be ovjective function, but it is not work. If i using int number, it is work. I don't know how to solve it.