Waikato / wekaDeeplearning4j

Weka package for the Deeplearning4j java library
https://deeplearning.cms.waikato.ac.nz/
GNU General Public License v3.0
184 stars 197 forks source link

Parse NetConfiguration from Zoo Model #49

Open braun-steven opened 5 years ago

braun-steven commented 5 years ago

As discussed with @m-a-hall:

is it possible to populate weka.dl4j.NeuralNetConfiguration with the settings extracted from the org.deeplearning4j.nn.conf.NeuralNetConfiguration attached to a zoo model? It would be quite nice to see (and be able to tweak) the default configuration for a given zoo model.

That should be partly possible. The thing is that the Dl4j Model define a MultiLayerConfiguration (see https://github.com/deeplearning4j/deeplearning4j/blob/308e141fe40bd8ff1a3d1f8cc75615c240089ef7/deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/AlexNet.java#L86) and with that allow for more fine-grained layer wise network configuration. Our implementation only has a network wide (one for all layers) configuration. Though, allmost all configurations are the same for all layers in the ModelZoo and are defined in the conf() method beginning (see https://github.com/deeplearning4j/deeplearning4j/blob/308e141fe4/deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/AlexNet.java#L89-L102).

It would be possible to try to parse a MultiLayerConfiguration of a ModelZoo into a Weka NeuralNetConfiguration by checking which values are the same over all layers.