Skip to content

Commit

Permalink
Train on the full dataset (#1)
Browse files Browse the repository at this point in the history
Changed the test script to run the dropout comparison on the full
dataset in an attempt to match the results in the 2014 paper.
  • Loading branch information
eric-tramel committed Sep 22, 2015
1 parent bd8c764 commit a45c458
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/testdropout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ using DataFrames

function run_mnist()
# Configure Test
X, y = testdata()
X, y = traindata()
HiddenUnits = 256
Epochs = 15
Epochs = 10
X = X ./ (maximum(X) - minimum(X))
m_do = BernoulliRBM(28*28, HiddenUnits; momentum=0.95)
m_do = BernoulliRBM(28*28, HiddenUnits; momentum=0.5)
m = BernoulliRBM(28*28, HiddenUnits; momentum = 0.5)

# Fit Models
m_do, historical_pl_do = fit(m_do, X; persistent=false, lr=0.1, n_iter=Epochs, batch_size=100,
n_gibbs=1, dorate=0.5, weight_decay="l1",decay_magnitude=0.1)
m, historical_pl = fit(m, X; persistent=true, lr=0.1, n_iter=Epochs, batch_size=100,
n_gibbs=1, dorate=0.0, weight_decay="l1",decay_magnitude=0.1)
# With Dropout
m_do, historical_pl_do = fit(m_do, X; persistent=false, lr=0.01, n_iter=Epochs, batch_size=100,
n_gibbs=1, dorate=0.5, weight_decay="l2",decay_magnitude=0.001)

# Put results in dataframe
m, historical_pl = fit(m, X; persistent=true, lr=0.01, n_iter=Epochs, batch_size=100,
n_gibbs=1, dorate=0.0, weight_decay="l2",decay_magnitude=0.001)

# Without Dropout
NoDropoutActivations = Boltzmann.transform(m,X)
DropoutActivations = Boltzmann.transform(m_do,X)

Expand Down

0 comments on commit a45c458

Please sign in to comment.