org.deeplearning4j.nn.multilayer.MultiLayerNetwork.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.deeplearning4j.nn.multilayer.MultiLayerNetwork.<init>()方法的一些代码示例,展示了MultiLayerNetwork.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiLayerNetwork.<init>()方法的具体详情如下:
包路径:org.deeplearning4j.nn.multilayer.MultiLayerNetwork
类名称:MultiLayerNetwork
方法名:<init>

MultiLayerNetwork.<init>介绍

[英]Initialize the network based on the configuration
[中]根据配置初始化网络

代码示例

代码示例来源:origin: deeplearning4j/dl4j-examples

.pretrain(false).backprop(true).build();
MultiLayerNetwork net = new MultiLayerNetwork(conf);
net.init();
net.setListeners(new PerformanceListener(10, true));

代码示例来源:origin: deeplearning4j/dl4j-examples

.setInputType(InputType.convolutionalFlat(28,28,1)) //See note below
  .backprop(true).pretrain(false).build();
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();

代码示例来源:origin: deeplearning4j/dl4j-examples

.setInputType(InputType.convolutionalFlat(28,28,1)) //See note below
  .backprop(true).pretrain(false).build();
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();

代码示例来源:origin: deeplearning4j/dl4j-examples

.setInputType(InputType.convolutionalFlat(28,28,1)) //See note below
  .backprop(true).pretrain(false).build();
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();

代码示例来源:origin: deeplearning4j/dl4j-examples

.build();
MultiLayerNetwork net = new MultiLayerNetwork(conf);
net.init();
net.setListeners(new ScoreIterationListener(1), new IterationListener() {

代码示例来源:origin: deeplearning4j/dl4j-examples

.build();
MultiLayerNetwork net = new MultiLayerNetwork(conf);
net.init();
net.setListeners(new ScoreIterationListener(1));

代码示例来源:origin: guoguibing/librec

.build();
autoRecModel = new MultiLayerNetwork(conf);
autoRecModel.init();

代码示例来源:origin: guoguibing/librec

.build();
CDAEModel = new MultiLayerNetwork(conf);
CDAEModel.init();

代码示例来源:origin: deeplearning4j/dl4j-examples

public static MultiLayerNetwork lenetModel() {
  /**
   * Revisde Lenet Model approach developed by ramgo2 achieves slightly above random
   * Reference: https://gist.github.com/ramgo2/833f12e92359a2da9e5c2fb6333351c5
   **/
  MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
      .seed(seed)
      .l2(0.005) // tried 0.0001, 0.0005
      .activation(Activation.RELU)
      .weightInit(WeightInit.XAVIER)
      .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
      .updater(new Nesterovs(0.0001,0.9))
      .list()
      .layer(0, new ConvolutionLayer.Builder(new int[]{5, 5}, new int[]{1, 1}, new int[]{0, 0}).name("cnn1")
          .nIn(channels).nOut(50).biasInit(0).build())
      .layer(1, new SubsamplingLayer.Builder(new int[]{2,2}, new int[]{2,2}).name("maxpool1").build())
      .layer(2, new ConvolutionLayer.Builder(new int[]{5,5}, new int[]{5, 5}, new int[]{1, 1}).name("cnn2")
          .nOut(100).biasInit(0).build())
      .layer(3, new SubsamplingLayer.Builder(new int[]{2,2}, new int[]{2,2}).name("maxpool2").build())
      .layer(4, new DenseLayer.Builder().nOut(500).build())
      .layer(5, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)
          .nOut(4)
          .activation(Activation.SOFTMAX)
          .build())
      .backprop(true).pretrain(false)
      .setInputType(InputType.convolutional(height, width, channels))
      .build();
  return new MultiLayerNetwork(conf);
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-nn

public EarlyStoppingTrainer(EarlyStoppingConfiguration<MultiLayerNetwork> earlyStoppingConfiguration,
        MultiLayerConfiguration configuration, DataSetIterator train) {
  this(earlyStoppingConfiguration, new MultiLayerNetwork(configuration), train);
  net.init();
}

代码示例来源:origin: de.datexis/texoo-core

public void loadConf(Resource confFile) {
 try {
  // Load network configuration from disk:
  MultiLayerConfiguration confFromJson = MultiLayerConfiguration.fromJson(IOUtils.toString(confFile.getInputStream()));
  // Create a MultiLayerNetwork from the saved configuration and parameters
  //confFromJson.setTrainingWorkspaceMode(WorkspaceMode.SINGLE);
  //confFromJson.setInferenceWorkspaceMode(WorkspaceMode.SINGLE);
  net = new MultiLayerNetwork(confFromJson);
  net.init();
 } catch (IOException ex) {
  log.error(ex.toString());
 }
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-zoo

@Override
public Model init() {
  MultiLayerNetwork network = new MultiLayerNetwork(conf());
  network.init();
  return network;
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-zoo

@Override
public Model init() {
  MultiLayerNetwork network = new MultiLayerNetwork(conf());
  network.init();
  return network;
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-zoo

@Override
public MultiLayerNetwork init() {
  MultiLayerNetwork network = new MultiLayerNetwork(conf());
  network.init();
  return network;
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-scaleout-akka

@Override
public void setup(Configuration conf) {
  MultiLayerConfiguration conf2 = MultiLayerConfiguration.fromJson(conf.get(MULTI_LAYER_CONF));
  multiLayerNetwork = new MultiLayerNetwork(conf2);
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-zoo

@Override
public Model init() {
  MultiLayerNetwork network = new MultiLayerNetwork(conf());
  network.init();
  return network;
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-zoo

@Override
public MultiLayerNetwork init() {
  MultiLayerConfiguration conf = conf();
  MultiLayerNetwork network = new MultiLayerNetwork(conf);
  network.init();
  return network;
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-zoo

@Override
public MultiLayerNetwork init() {
  MultiLayerNetwork network = new MultiLayerNetwork(conf());
  network.init();
  return network;
}

代码示例来源:origin: de.datexis/texoo-core

public void setLayerConfiguration(JsonNode conf) {
 if(conf != null) {
  String json = conf.toString();
  if(json != null && !json.equals("null")) {
   net = new MultiLayerNetwork(MultiLayerConfiguration.fromJson(json));
   net.init();
  }
 }
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-modelimport

/**
   * Build a MultiLayerNetwork from this Keras Sequential model configuration and import weights.
   *
   * @return          MultiLayerNetwork
   */
  public MultiLayerNetwork getMultiLayerNetwork(boolean importWeights)
          throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
    MultiLayerNetwork model = new MultiLayerNetwork(getMultiLayerConfiguration());
    model.init();
    if (importWeights)
      model = (MultiLayerNetwork) helperCopyWeightsToModel(model);
    return model;
  }
}

相关文章