Commit 13328ec9 authored by Ines Filipa Fernandes Ramos's avatar Ines Filipa Fernandes Ramos
Browse files

added simple CNN notebook

parent 9fe32e10
This diff is collapsed.
......@@ -431,7 +431,7 @@ def MEI_multi_seed(dataset_name, dat, dataloaders, models, n_seeds, MEIParameter
return MEI
def multi_MEI_class():
class multi_MEI_class:
"""
dataset_name : string # string with dataset_name of dataset used for training
dat : object # fileTreeDataset object with data schema of data
......@@ -468,17 +468,16 @@ def multi_MEI_class():
self.dataset_name = dataset_name
self.dat = dat
self.dataloaders = dataloaders
sel.models = models
self.models_name = nameof(models)
self.models = models
self.n_seeds = n_seeds
self.MEIParameter = MEIParameter
self.MEIProperties = []
self.MEIProperties = {}
def generate(self, neuron_id, track = False):
print('Working on neuron_id={}'.format(neuron_id))
# get input statistics
dataset, img_shape, bias, mu_beh, mu_eye, scale = prepare_data(dataloaders=self.dataloaders,dataset_name=self.dataset_name,dat=self.dat)
dataset, img_shape, bias, mu_beh, mu_eye, scale = prepare_data(dataloaders = self.dataloaders, dataset_name = self.dataset_name, dat = self.dat)
print('Working with images with mu={}, sigma={}'.format(bias, scale))
# get n instances of model for target unit
......@@ -525,9 +524,7 @@ def multi_MEI_class():
cont, vals, lim_contrast = contrast_tuning(adj_model, mei, bias, scale)
MEI = {
'neuron_id' : neuron_id,
'n_seeds' : self.n_seeds,
MEI = {'n_seeds' : self.n_seeds,
'mei' : mei,
'activation' : activation,
'monotonic' : bool(np.all(np.diff(vals) >= 0)),
......@@ -538,6 +535,6 @@ def multi_MEI_class():
'lim_contrast' : lim_contrast,
}
self.MEIProperties.append(MEI)
self.MEIProperties['neuron_id : '+str(neuron_id)] = MEI
return MEI['mei']
\ No newline at end of file
......@@ -6848,7 +6848,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.8.8"
}
},
"nbformat": 4,
......
......@@ -58666,7 +58666,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.8.8"
}
},
"nbformat": 4,
This diff is collapsed.
......@@ -2769,7 +2769,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.8.8"
}
},
"nbformat": 4,
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment