-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcount_testvaltrain.py
57 lines (48 loc) · 1.66 KB
/
count_testvaltrain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import numpy as np
import pickle
import os
import ipdb
folder = 'storage'
x_train = pickle.load(open(os.path.join(folder, 'x_train_inhibitory_excitatory.pkl'), 'rb'))
x_val = pickle.load(open(os.path.join(folder, 'x_val_inhibitory_excitatory.pkl'), 'rb'))
x_test = pickle.load(open(os.path.join(folder, 'x_test_inhibitory_excitatory.pkl'), 'rb'))
#y_train = pickle.load(open(os.path.join(folder, 'y_train_inhibitory_excitatory.pkl'), 'rb'))
#y_val = pickle.load(open(os.path.join(folder, 'y_val_inhibitory_excitatory.pkl'), 'rb'))
#y_test = pickle.load(open(os.path.join(folder, 'y_test_inhibitory_excitatory.pkl'), 'rb'))
unique_cells_pre = {'train':set(), 'val':set(), 'test':set()}
excitatory = {'train':0, 'val':0, 'test':0}
inhibitory = {'train':0, 'val':0, 'test':0}
for x in x_train:
if 'excitatory' in x:
excitatory['train'] += 1
elif 'inhibitory' in x:
inhibitory['train'] += 1
presyn = os.path.split(x)[-1].replace('_','-').split('-')[1].lower()
if 'synapse' in presyn:
presyn = presyn[9:]
else:
presyn = presyn[5:]
unique_cells_pre['train'].add(presyn)
for x in x_val:
if 'excitatory' in x:
excitatory['val'] += 1
elif 'inhibitory' in x:
inhibitory['val'] += 1
presyn = os.path.split(x)[-1].replace('_','-').split('-')[1].lower()
if 'synapse' in presyn:
presyn = presyn[9:]
else:
presyn = presyn[5:]
unique_cells_pre['val'].add(presyn)
for x in x_test:
if 'excitatory' in x:
excitatory['test'] += 1
elif 'inhibitory' in x:
inhibitory['test'] += 1
presyn = os.path.split(x)[-1].replace('_','-').split('-')[1].lower()
if 'synapse' in presyn:
presyn = presyn[9:]
else:
presyn = presyn[5:]
unique_cells_pre['test'].add(presyn)
ipdb.set_trace()