26 May 2016
I trained a simple fp_linear network (FingerprintLayer -> Linear Regression) to learn how to count the sum of all of the nodes. This was a sanity check before progressing further with training on actual HIV data.
I was expecting that most of the weights and biases should be some really small number close to zero, while the final linear regression weights should be something close to the array [0, 1, 2, 3, 4, ..., N] for N features.
In [26]:
import pickle as pkl
from pprint import pprint
In [44]:
def open_wb(path):
with open(path, 'rb') as f:
wb = pkl.load(f)
return wb
wb = open_wb('../experiments/wbs/fp_linear-cf.score_sum-5000_iters-10_wb.pkl')
In [45]:
pprint(wb)
Okay, focus in on the LinReg weights:
In [46]:
wb['layer1_LinearRegressionLayer']['linweights'].shape
Out[46]:
In [47]:
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
sns.set_style('white')
sns.set_context('poster')
%matplotlib inline
In [48]:
plt.bar(np.arange(1, 11) - 0.35, wb['layer1_LinearRegressionLayer']['linweights'])
Out[48]:
Exactly what I was expecting! Yay!
I'm also curious to see what the weights and biases look like for score_sine.
In [ ]:
wb = open_wb('../experiments/wbs/')