Example usage for weka.classifiers.functions.neural NeuralConnection getType

List of usage examples for weka.classifiers.functions.neural NeuralConnection getType

Introduction

In this page you can find the example usage for weka.classifiers.functions.neural NeuralConnection getType.

Prototype

public int getType() 

Source Link

Usage

From source file:com.ifmo.recommendersystem.metafeatures.classifierbased.internal.extractors.MultilayerPerceptron.java

License:Open Source License

/**
 * This will go through all the nodes and check if they are connected to a
 * pure output unit. If so they will be set to be linear units. If not they
 * will be set to be sigmoid units./*from   w w w.j  av  a  2 s  .  co m*/
 */
private void setEndsToLinear() {
    for (NeuralConnection m_neuralNode : m_neuralNodes) {
        if ((m_neuralNode.getType() & NeuralConnection.OUTPUT) == NeuralConnection.OUTPUT) {
            ((NeuralNode) m_neuralNode).setMethod(m_linearUnit);
        } else {
            ((NeuralNode) m_neuralNode).setMethod(m_sigmoidUnit);
        }
    }
}