Codota Logo
ActivationLayer
Code IndexAdd Codota to your IDE (free)

How to use
ActivationLayer
in
org.deeplearning4j.nn.conf.layers

Best Java code snippets using org.deeplearning4j.nn.conf.layers.ActivationLayer (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: Waikato/wekaDeeplearning4j

 @Override
 public void initializeBackend() {
  this.backend = new org.deeplearning4j.nn.conf.layers.ActivationLayer();
  this.backend.setActivationFn(new ActivationReLU());
 }
}
origin: org.deeplearning4j/deeplearning4j-nn

@Override
public InputType getOutputType(int layerIndex, InputType inputType) {
  if (inputType == null)
    throw new IllegalStateException("Invalid input type: null for layer name \"" + getLayerName() + "\"");
  return inputType;
}
origin: Waikato/wekaDeeplearning4j

@OptionMetadata(
  displayName = "activation function",
  description = "The activation function to use (default = Identity).",
  commandLineParamName = "activation",
  commandLineParamSynopsis = "-activation <specification>",
  displayOrder = 1
)
public Activation getActivationFunction() {
 return Activation.create(backend.getActivationFn());
}
origin: org.deeplearning4j/deeplearning4j-nn

  @Override
  @SuppressWarnings("unchecked")
  public ActivationLayer build() {
    return new ActivationLayer(this);
  }
}
origin: Waikato/wekaDeeplearning4j

public void setActivationFunction(Activation activationFn) {
 backend.setActivationFn(activationFn.getBackend());
}
origin: org.deeplearning4j/deeplearning4j-modelimport

/**
 * Get layer output type.
 *
 * @param  inputType    Array of InputTypes
 * @return              output type as InputType
 * @throws InvalidKerasConfigurationException
 */
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
  if (inputType.length > 1)
    throw new InvalidKerasConfigurationException(
            "Keras Activation layer accepts only one input (received " + inputType.length + ")");
  return this.getActivationLayer().getOutputType(-1, inputType[0]);
}
origin: org.deeplearning4j/deeplearning4j-nn

@Override
public Layer instantiate(NeuralNetConfiguration conf, Collection<IterationListener> iterationListeners,
        int layerIndex, INDArray layerParamsView, boolean initializeParams) {
  org.deeplearning4j.nn.layers.ActivationLayer ret = new org.deeplearning4j.nn.layers.ActivationLayer(conf);
  ret.setListeners(iterationListeners);
  ret.setIndex(layerIndex);
  ret.setParamsViewArray(layerParamsView);
  Map<String, INDArray> paramTable = initializer().init(conf, layerParamsView, initializeParams);
  ret.setParamTable(paramTable);
  ret.setConf(conf);
  return ret;
}
origin: org.deeplearning4j/deeplearning4j-nn

@Override
public INDArray activate(boolean training) {
  if (input == null) {
    throw new IllegalArgumentException("Cannot do forward pass with null input " + layerId());
  }
  applyDropOutIfNecessary(training);
  INDArray in;
  if (training) {
    //dup required: need to keep original input for backprop
    in = input.dup();
  } else {
    in = input;
  }
  //return Nd4j.getExecutioner().execAndReturn(Nd4j.getOpFactory().createTransform(conf.getLayer().getActivationFunction(), in));
  return layerConf().getActivationFn().getActivation(in, training);
}
origin: org.deeplearning4j/deeplearning4j-nn

@Override
public Pair<Gradient, INDArray> backpropGradient(INDArray epsilon) {
  INDArray delta = layerConf().getActivationFn().backprop(input.dup(), epsilon).getFirst(); //TODO handle activation function params
  if (maskArray != null) {
    delta.muliColumnVector(maskArray);
  }
  Gradient ret = new DefaultGradient();
  return new Pair<>(ret, delta);
}
org.deeplearning4j.nn.conf.layersActivationLayer

Most used methods

  • <init>
  • getActivationFn
  • getLayerName
  • getOutputType
  • initializer
  • setActivationFn

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now