Skip to content

Commit

Permalink
stage 1 covariance matrices are similar when normalized
Browse files Browse the repository at this point in the history
compared my cov1 to og matlab cov1, where each was divided by its max
element so all values are from 0 to 1. Max difference was 1e-2
Max difference when compares to randn() was 1.5, so I think I got
covariance of patches right. Not sure why the scale is different. Might
be because of batch size
  • Loading branch information
PeterMitrano committed May 19, 2017
1 parent 4eea04c commit 0769c53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dataset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def load(name):

info = datasets[name]

batch_size = 500
batch_size = 100

with tf.name_scope('input'):
filename_queue = tf.train.string_input_producer([info.TRAIN_RECORD_PATH], name='train_queue')
Expand Down
4 changes: 4 additions & 0 deletions pcanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ def main():
train_pcanet_features, train_labels, summary = sess.run([m.output_features, train_label_batch, merged_summary])
writer.add_summary(summary, 0)

cov = sess.run(m.patches_covariance1)
np.savetxt('cov.csv', np.squeeze(cov))
exit(0)

# train linear SVM
svm = LinearSVC(C=1, fit_intercept=False)
svm.fit(train_pcanet_features, train_labels)
Expand Down

0 comments on commit 0769c53

Please sign in to comment.