DL4J中文文档/Keras模型导入/循环层

2019-01-17  本文已影响0人  hello风一样的男子

KerasLSTM

[源码]

导入一个Keras的LSTM层作为DL4J的LSTM层。

KerasLSTM

public KerasLSTM(Integer kerasVersion) throws UnsupportedKerasConfigurationException 

image.gif

从KerasLayer传递构造函数

getLSTMLayer

public Layer getLSTMLayer() 

image.gif

获取LSTM层

public KerasLstm(Map<String, Object> layerConfig)
                    throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
image.gif

来自解析的keras层配置字典的构造函数。

getOutputType

public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException 

image.gif

获取层输出类型

getNumParams

public int getNumParams() 

image.gif

返回层中可训练参数的数目。

getInputPreprocessor

public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException 

image.gif

为给定的输入类型获取适合的DL4J输入预处理器

setWeights

public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException 

image.gif

为层设置权重。

getUnroll

public boolean getUnroll() 

image.gif

获取是否应展开LSTM层(对于截断的BPTT)。

getGateActivationFromConfig

public IActivation getGateActivationFromConfig(Map<String, Object> layerConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException 

image.gif

从Keras层配置中获取LSTM门激活函数。

getForgetBiasInitFromConfig

public double getForgetBiasInitFromConfig(Map<String, Object> layerConfig, boolean train)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException 

image.gif

从keras层配置中获取lstm 遗忘门偏置初始化。


KerasRnnUtils

[源码]

keras rnn层的实用功能

getUnrollRecurrentLayer

public static boolean getUnrollRecurrentLayer(KerasLayerConfiguration conf, Map<String, Object> layerConfig)
            throws InvalidKerasConfigurationException 

image.gif

获取unroll参数以决定是否使用BPTT展开rnn。

getRecurrentDropout

public static double getRecurrentDropout(KerasLayerConfiguration conf, Map<String, Object> layerConfig)
            throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException 

image.gif

Get recurrent weight dropout from Keras layer configuration. Non-zero dropout rates are currently not supported.

从Keras层配置中获得权重dropout。当前不支持非零dropout。


KerasSimpleRnn

[源码]

导入一个Keras的SimpleRNN层作为一个DL4J的SimpleRnn层。

KerasSimpleRnn

public KerasSimpleRnn(Integer kerasVersion) throws UnsupportedKerasConfigurationException 

image.gif

从KerasLayer传递构造函数

getSimpleRnnLayer

public Layer getSimpleRnnLayer() 

image.gif

获取SimpleRnn层。

public KerasSimpleRnn(Map<String, Object> layerConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException 
image.gif

来自解析的keras层配置字典的构造函数。

getOutputType

public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException 

image.gif

获取层输出类型

getNumParams

public int getNumParams() 

image.gif

返回层中可训练参数的数目。

getInputPreprocessor

public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException 

image.gif

为给定的输入类型获取适合的DL4J输入预处理器

getUnroll

public boolean getUnroll() 

image.gif

获取是否应展开SimpleRNN层(对于截断的BPTT)。

setWeights

public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException 

image.gif

为层设置权重。

上一篇 下一篇

猜你喜欢

热点阅读