This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Multi-layer perceptron inspired by this: https://gym.openai.com/evaluations/eval_P4KyYPwIQdSg6EqvHgYjiw | |
# https://gist.githubusercontent.com/anonymous/d829ec2f8bda088ac897aa2055dcd3a8/raw/d3fcdfdcc9038bf24385589e94939dcd3c198349/crossentropy_method.py | |
import gym | |
import argparse | |
from gym import wrappers | |
import numpy as np | |
from keras.models import Sequential | |
from keras.layers import Dense, Activation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15/10/27 15:19:34 WARN TaskSetManager: Lost task 39.0 in stage 0.0 (TID 39, 10.106.1.52): java.lang.IllegalStateException: Function did not decrease: score = 6.34683125 > 6.3463484375 = oldScore | |
at org.deeplearning4j.optimize.solvers.BackTrackLineSearch.optimize(BackTrackLineSearch.java:251) | |
at org.deeplearning4j.optimize.solvers.BaseOptimizer.optimize(BaseOptimizer.java:171) | |
at org.deeplearning4j.optimize.Solver.optimize(Solver.java:52) | |
at org.deeplearning4j.nn.layers.BaseLayer.fit(BaseLayer.java:471) | |
at org.deeplearning4j.nn.layers.feedforward.rbm.RBM.fit(RBM.java:410) | |
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.pretrain(MultiLayerNetwork.java:214) | |
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.fit(MultiLayerNetwork.java:1336) | |
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.fit(MultiLayerNetwork.java:1382) | |
at org.deeplearning4j.spark.impl.multilayer.IterativeReduceFlatMap.call(IterativeReduceFlatMap.java:87) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static MultiLayerNetwork createRBMModel(int iterations, int features, int hidden) { | |
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() | |
.seed(123) | |
.iterations(iterations) | |
.learningRate(1e-1) | |
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT) | |
.constrainGradientToUnitNorm(true) | |
.momentum(0.9) | |
.list(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
import java.util.Random; | |
import org.apache.hadoop.io.BytesWritable; | |
import org.apache.hadoop.io.Writable; | |
import org.apache.hadoop.io.WritableComparable; | |
import org.apache.hadoop.conf.Configuration; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test |
NewerOlder