Skip to content

Instantly share code, notes, and snippets.

View ieee8023's full-sized avatar

Joseph Paul Cohen ieee8023

View GitHub Profile
MultiLayerConfiguration.Builder builder = new NeuralNetConfiguration.Builder()
.seed(seed)
.batchSize(batchSize)
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.list(3)
.layer(0, new ConvolutionLayer.Builder(5, 5)
.nIn(nChannels)
.nOut(6)
.weightInit(WeightInit.XAVIER)
.activation("relu")
OutputStream fos = Files.newOutputStream(Paths.get("coefficients.bin"));
ObjectOutputStream dos = new ObjectOutputStream(fos);
dos.writeObject(model.params());
dos.flush();
dos.close();
FileUtils.write(new File("conf.json"), model.getLayerWiseConfigurations().toJson());
MultiLayerConfiguration confFromJson = MultiLayerConfiguration.fromJson(FileUtils.readFileToString(new File("conf.json")));
ObjectInputStream dis = new ObjectInputStream(new FileInputStream("coefficients.bin"));
INDArray newParams = (INDArray) dis.readObject();
Oct 17, 2015 11:31:58 AM com.github.fommil.jni.JniLoader liberalLoad
INFO: successfully loaded /var/folders/qv/50967tw918d57xzs30dg_jy40000gn/T/jniloader112843500445793214netlib-native_system-osx-x86_64.jnilib
11:31:58.216 [main] DEBUG org.reflections.Reflections - going to scan these urls:
jar:file:/Users/ieee8023/Documents/workspace3/NeuralNetworkDL4J2/lib/nd4j-x86-0.4-rc3.5.jar!/
jar:file:/Users/ieee8023/Documents/workspace3/NeuralNetworkDL4J2/lib/nd4j-jackson-0.4-rc3.5.jar!/
jar:file:/Users/ieee8023/Documents/workspace3/NeuralNetworkDL4J2/lib/nd4j-api-0.4-rc3.5.jar!/
jar:file:/Users/ieee8023/Documents/workspace3/NeuralNetworkDL4J2/lib/nd4j-jblas-0.4-rc3.5.jar!/
jar:file:/Users/ieee8023/Documents/workspace3/NeuralNetworkDL4J2/lib/nd4j-bytebuddy-0.4-rc3.5.jar!/
11:31:58.313 [main] DEBUG org.reflections.Reflections - could not scan file org/nd4j/linalg/cpu/javacpp/linux-x86_64/libjniLoop.so in url jar:file:/Users/ieee8023/Documents/workspace3/NeuralNetworkDL4J2/lib/nd4j-x86-0.4-rc3.5.jar!/ with scanner SubTy
https://gist.github.com/ieee8023/3df2a966e789861cc7f4
(function(t, e, i) {
function o(t) {
return t
}
function n(t) {
var e, i = [],
o = function() {
var o = arguments,
n = o.length;