@@ -29,7 +29,7 @@ def map_index_to_rgb_color(index):
29
29
return map_index_to_rgb_color
30
30
31
31
32
- def plot_logits (subject , data_path , model_path , test_labels , dataset = 'test' ):
32
+ def plot_features (subject , data_path , model_path , test_labels , dataset = 'test' ):
33
33
with open (model_path + '/' + subject + '.pickle' , 'rb' ) as f :
34
34
state_dict = cPickle .load (f )
35
35
cnn = ConvNet (state_dict ['params' ])
@@ -50,10 +50,10 @@ def plot_logits(subject, data_path, model_path, test_labels, dataset='test'):
50
50
else scale_across_features (x , x_test = None , scalers = scalers )
51
51
52
52
cnn .batch_size .set_value (x .shape [0 ])
53
- get_logits = theano .function ([cnn .x , Param (cnn .training_mode , default = 0 )], cnn .feature_extractor .output ,
53
+ get_features = theano .function ([cnn .x , Param (cnn .training_mode , default = 0 )], cnn .feature_extractor .output ,
54
54
allow_input_downcast = True )
55
55
56
- logits_test = get_logits (x )
56
+ logits_test = get_features (x )
57
57
model = TSNE (n_components = 2 , random_state = 0 )
58
58
z = model .fit_transform (np .float64 (logits_test ))
59
59
plt .scatter (z [:, 0 ], z [:, 1 ], s = 60 , c = y )
@@ -191,5 +191,5 @@ def plot_sequences(subject, data_path, test_labels):
191
191
for subject in subjects :
192
192
print '***********************' , subject , '***************************'
193
193
plot_train_test (subject , data_path )
194
- plot_logits (subject , data_path , model_path , labels_df [subject ], dataset = 'train' )
194
+ plot_features (subject , data_path , model_path , labels_df [subject ], dataset = 'train' )
195
195
plot_sequences (subject , data_path , labels_df [subject ])
0 commit comments