from code import utils, architecture_1, architecture_2, load_data import code.histograms as h train, train_cleaned, test = load_data.load_data() h.plot_train_hist(train, train_cleaned) h.train_clean_diff(train, train_cleaned) h.get_correlation(train_cleaned, 0) h.obtain_freq(train, .75) h.data_threshold(train, .2474) hist_pred = h.predict(train, .749) arch1 = architecture_1.model() arch1.fit(train, train_cleaned) arch1_pred = arch1.predict(train) utils.display_prediction([train, train_cleaned, hist_pred, arch1_pred], cols=2, labels=['ori', 'cleaned', 'hist', 'conv'], index=0)
from nose.tools import assert_equal, assert_true, assert_raises, assert_almost_equal from code import architectures, load_data from numpy.testing import assert_array_almost_equal import pdb train = load_data.load_data('train', max_images=2) cleaned = load_data.load_data('train_cleaned', max_images=2) avg = load_data.load_data('train_avg', max_images=2) def setup(): print("SETUP!") def teardown(): print("TEAR DOWN!") def test_basic(): print("I RAN!") def model1(): model = architectures.model(1, [3], [2], 't0') model.fit(train, cleaned, 1) def model2(): model = architectures.model(2, [1,3], [3, 3], 't1') model.fit(train, cleaned, 1) def model3(): model = architectures.model(3, [1,3], [3, 3], 't1') model.fit(train, cleaned, 1, X2=avg)