DL4J中文文档/Keras模型导入/核心层

Keras 核心层


KerasFlatten

[源码]

作为DL4J的Cnn或Rnn将Keras的Flatten层导入到前馈InputPreProcessor(输入预入理器)

KerasFlatten

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

isInputPreProcessor(是否为输入预处理器)

public boolean isInputPreProcessor() 

返回布尔值

public KerasFlatten(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
                    throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getInputPreprocessor

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

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

  • 参数 inputType 输入类型数组
  • 返回 DL4J 输入预处理器
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 查看  org.deeplearning4j.nn.conf.InputPreProcessor

getOutputType

扫描二维码关注公众号,回复: 5080541 查看本文章
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException 

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置

KerasPermute

[源码]

从Keras导入Permute层

KerasPermute

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

isInputPreProcessor(是否为输入预处理器)

public boolean isInputPreProcessor() 

返回布尔值

public KerasPermute(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getInputPreprocessor

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

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

  • 参数 inputType 输入类型数组
  • 返回 DL4J 输入预处理器
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 查看  org.deeplearning4j.nn.conf.InputPreProcessor

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置

KerasRepeatVector

[源码]

导入Keras的RepeatVector层

KerasRepeatVector

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
public KerasRepeatVector(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getRepeatVectorLayer

public RepeatVector getRepeatVectorLayer() 

获取 DL4J RepeatVector.

  • 返回  RepeatVector

KerasMasking

[源码]

导入Keras遮罩层

KerasMasking

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
public KerasMasking(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getMaskingLayer

public MaskZeroLayer getMaskingLayer() 

获取  DL4J MaskZeroLayer.

  • 返回 MaskZeroLayer

KerasActivation

[源码]

从Keras导入一个激活层

KerasActivation

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
public KerasActivation(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getActivationLayer

public ActivationLayer getActivationLayer() 

获取 DL4J ActivationLayer.

  • 返回 ActivationLayer

KerasSpatialDropout

[源码]

用于DL4J dropout层的Keras包装器,带有SpatialDropout,用于1D到3D.

KerasSpatialDropout

public KerasSpatialDropout(Integer kerasVersion) throws UnsupportedKerasConfigurationException 

从KerasLayer传递构造函数

  • 参数 kerasVersion Keras主版本
  • 抛出 UnsupportedKerasConfigurationException 不支持的 Keras 配置

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
public KerasSpatialDropout(Map<String, Object> layerConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getSpatialDropoutLayer

public DropoutLayer getSpatialDropoutLayer() 

获取 带有空间 dropout的DL4J DropoutLayer 

  • 返回 DropoutLayer

KerasLambda

[源码]

将DL4J SamedifFlambda包装到Keraslayer中

KerasLambda

public KerasLambda(Map<String, Object> layerConfig, SameDiffLayer sameDiffLayer)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException 

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
public KerasLambda(Map<String, Object> layerConfig, boolean enforceTrainingConfig,
                       SameDiffLayer sameDiffLayer)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getSameDiffLayer

public SameDiffLayer getSameDiffLayer() 

获取 DL4J SameDiffLayer.

  • 返回 SameDiffLayer

KerasReshape

[源码]

从Keras导入Reshape层

KerasReshape

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

isInputPreProcessor

public boolean isInputPreProcessor() 
 public KerasReshape(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getInputPreprocessor

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

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

  • 参数 inputType 输入类型数组
  • 返回 DL4J 输入预处理器
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 查看  org.deeplearning4j.nn.conf.InputPreProcessor

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置

KerasMerge

[源码]

导入一个Keras合并层作为DL4J的合并顶点

TODO: 处理改变合并行为的轴参数(需要更改dl4j?)

KerasMerge

public KerasMerge(Integer kerasVersion) throws UnsupportedKerasConfigurationException 

从KerasLayer传递构造函数

  • 参数 kerasVersion Keras主版本
  • 抛出 UnsupportedKerasConfigurationException 不支持的 Keras 配置

getOutputType

public InputType getOutputType(InputType... inputType) 

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
 public KerasMerge(Map<String, Object> layerConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException 

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

KerasDropout

[源码]

从Keras导入Dropout层

KerasDropout

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
public KerasDropout(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
                    throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

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

  • 参数 layerConfig 包含keras层配置的字典
  • 参数 enforceTrainingConfig 是否强制执行与训练相关的配置选项
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getDropoutLayer

public DropoutLayer getDropoutLayer() 

 获取 DL4J DropoutLayer.

  • 返回 DropoutLayer

KerasDense

[源码]

 从Keras导入一个密连层

KerasDense

public KerasDense(Integer kerasVersion) throws UnsupportedKerasConfigurationException 

从KerasLayer传递构造函数

  • 参数 kerasVersion Keras主版本
  • 抛出 UnsupportedKerasConfigurationException 不支持的 Keras 配置

getDenseLayer

public DenseLayer getDenseLayer() 

获取密连层 

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

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

  • 参数 layerConfig 包含keras层配置的字典
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置
  • 抛出 UnsupportedKerasConfigurationException 不支持的无效的 Keras 配置

getOutputType

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

获取层输出类型

  • 参数 inputType 输入类型数组
  • 返回 按输入类型返回输出类型
  • 抛出 InvalidKerasConfigurationException 无效的 Keras 配置

getNumParams

public int getNumParams() 

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

setWeights

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

设置层的权重

  • 参数 weights  密连层权重

猜你喜欢

转载自blog.csdn.net/bewithme/article/details/86493474