Examples of ActivationFunction


Examples of org.dmg.pmml._40.ACTIVATIONFUNCTION

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setActivationFunction(ACTIVATIONFUNCTION newActivationFunction) {
    ACTIVATIONFUNCTION oldActivationFunction = activationFunction;
    activationFunction = newActivationFunction == null ? ACTIVATION_FUNCTION_EDEFAULT : newActivationFunction;
    boolean oldActivationFunctionESet = activationFunctionESet;
    activationFunctionESet = true;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, _40Package.NEURAL_NETWORK_TYPE__ACTIVATION_FUNCTION, oldActivationFunction, activationFunction, !oldActivationFunctionESet));
View Full Code Here

Examples of org.dmg.pmml._40.ACTIVATIONFUNCTION

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void unsetActivationFunction() {
    ACTIVATIONFUNCTION oldActivationFunction = activationFunction;
    boolean oldActivationFunctionESet = activationFunctionESet;
    activationFunction = ACTIVATION_FUNCTION_EDEFAULT;
    activationFunctionESet = false;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.UNSET, _40Package.NEURAL_NETWORK_TYPE__ACTIVATION_FUNCTION, oldActivationFunction, ACTIVATION_FUNCTION_EDEFAULT, oldActivationFunctionESet));
View Full Code Here

Examples of org.dmg.pmml._40.ACTIVATIONFUNCTION

   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String getText(Object object) {
    ACTIVATIONFUNCTION labelValue = ((NeuralLayerType)object).getActivationFunction();
    String label = labelValue == null ? null : labelValue.toString();
    return label == null || label.length() == 0 ?
      getString("_UI_NeuralLayerType_type") :
      getString("_UI_NeuralLayerType_type") + " " + label;
  }
View Full Code Here

Examples of org.encog.engine.network.activation.ActivationFunction

    Class<?> t = transferFunctions.iterator().next();

    double slope = 1;

    ActivationFunction activation = null;
   
    if (inputLayer)
      activation = new ActivationLinear();
    else if (t == Linear.class) {
      slope = ((Linear) transfer).getSlope();
View Full Code Here

Examples of org.encog.engine.network.activation.ActivationFunction

  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
   
  private NEATNetwork create()
  {
    List<NEATNeuron> neurons = new ArrayList<NEATNeuron>();
    ActivationFunction afSigmoid = new ActivationSigmoid();
    ActivationFunction afStep = new ActivationStep();
   
    // create the neurons
    NEATNeuron input1 = new NEATNeuron(
        NEATNeuronType.Input,
        1,
View Full Code Here

Examples of org.encog.engine.network.activation.ActivationFunction

        flat.setActivationFunctions(new ActivationFunction[flat
            .getLayerCounts().length]);

        for (final String line : section.getLines()) {
          ActivationFunction af = null;
          final List<String> cols = EncogFileSection
              .splitColumns(line);
          final String name = "org.encog.engine.network.activation."
              + cols.get(0);
          try {
            final Class<?> clazz = Class.forName(name);
            af = (ActivationFunction) clazz.newInstance();
          } catch (final ClassNotFoundException e) {
            throw new PersistError(e);
          } catch (final InstantiationException e) {
            throw new PersistError(e);
          } catch (final IllegalAccessException e) {
            throw new PersistError(e);
          }

          for (int i = 0; i < af.getParamNames().length; i++) {
            af.setParam(i,
                CSVFormat.EG_FORMAT.parse(cols.get(i + 1)));
          }

          flat.getActivationFunctions()[index++] = af;
        }
View Full Code Here

Examples of org.encog.engine.network.activation.ActivationFunction

   *            True if this is a tanh activation, false for sigmoid.
   */
  public FlatNetwork(final int input, final int hidden1, final int hidden2,
      final int output, final boolean tanh) {

    final ActivationFunction linearAct = new ActivationLinear();
    FlatLayer[] layers;
    final ActivationFunction act = tanh ? new ActivationTANH()
        : new ActivationSigmoid();

    if ((hidden1 == 0) && (hidden2 == 0)) {
      layers = new FlatLayer[2];
      layers[0] = new FlatLayer(linearAct, input,
View Full Code Here

Examples of org.encog.engine.network.activation.ActivationFunction

        flat.setActivationFunctions(new ActivationFunction[flat
            .getLayerCounts().length]);

        for (final String line : section.getLines()) {
          ActivationFunction af = null;
          final List<String> cols = EncogFileSection
              .splitColumns(line);
          final String name = "org.encog.engine.network.activation."
              + cols.get(0);
          try {
            final Class<?> clazz = Class.forName(name);
            af = (ActivationFunction) clazz.newInstance();
          } catch (final ClassNotFoundException e) {
            throw new PersistError(e);
          } catch (final InstantiationException e) {
            throw new PersistError(e);
          } catch (final IllegalAccessException e) {
            throw new PersistError(e);
          }

          for (int i = 0; i < af.getParamNames().length; i++) {
            af.setParam(i,
                CSVFormat.EG_FORMAT.parse(cols.get(i + 1)));
          }

          flat.getActivationFunctions()[index++] = af;
        }
View Full Code Here

Examples of org.encog.engine.network.activation.ActivationFunction

    } else {
      name = fn.toLowerCase();
      params = new double[0];
    }

    ActivationFunction af = allocateAF(name);
   
    if( af==null ) {
      return null;
    }

    if (af.getParamNames().length != params.length) {
      throw new EncogError(name + " expected "
          + af.getParamNames().length + ", but " + params.length
          + " were provided.");
    }

    for (int i = 0; i < af.getParamNames().length; i++) {
      af.setParam(i, params[i]);
    }

    return af;
  }
View Full Code Here

Examples of org.encog.engine.network.activation.ActivationFunction

   */
  public FlatNetwork(final int input, final int hidden1, final int hidden2,
      final int output, final boolean tanh) {
    final double[] params = new double[1];
    FlatLayer[] layers;
    final ActivationFunction act = tanh ? new ActivationTANH()
        : new ActivationSigmoid();
    params[0] = 1; // slope

    if ((hidden1 == 0) && (hidden2 == 0)) {
      layers = new FlatLayer[2];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.