Skip to content

Instantly share code, notes, and snippets.

@kudkudak
Created November 4, 2014 18:16
Show Gist options
  • Save kudkudak/5bde9880e42f0df8637d to your computer and use it in GitHub Desktop.
Save kudkudak/5bde9880e42f0df8637d to your computer and use it in GitHub Desktop.
dataset = DenseDesignMatrix(X=X_train, y=Y_train[:,11:12].reshape(-1,1).astype("int64"))
hidden_layer = mlp.Sigmoid(layer_name='hidden', dim=1000, sparse_init =15, init_bias=1.)
output_layer = mlp.Softmax(n_classes=1, sparse_init =1, layer_name='output')
layers = [hidden_layer, output_layer]
ann = mlp.MLP(layers, nvis=X_train.shape[1])
trainer = sgd.SGD(
learning_rate=.05, batch_size=250, termination_criterion=EpochCounter(10), monitoring_dataset=dataset)
trainer.setup(ann,dataset)
while True:
trainer.train(dataset=dataset)
ann.monitor.report_epoch()
ann.monitor()
if not trainer.continue_learning(ann):
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment