Skip to content

Instantly share code, notes, and snippets.

@LplusKira
Created December 17, 2015 02:35
Show Gist options
  • Save LplusKira/121e51f748c797270538 to your computer and use it in GitHub Desktop.
Save LplusKira/121e51f748c797270538 to your computer and use it in GitHub Desktop.
...
log.info("Reload model ... ")
val confFromJson = MultiLayerConfiguration.fromJson(FileUtils.readFileToString(new File(conf_json)))
val dis = new DataInputStream(new FileInputStream(coefficient_bin))
val reloadParams = Nd4j.read(dis)
dis.close()
val model = new MultiLayerNetwork(confFromJson)
model.init()
model.setParams(reloadParams)
model.setListeners(Seq[IterationListener](new ScoreIterationListener(listenerFreq)).asJava)
while( iter.hasNext() ){
val eachbatch: DataSet = iter.next()
model.fit(eachbatch)
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment