Package edu.cmu.tetrad.search.utils
Class MultiLayerPerceptron
java.lang.Object
edu.cmu.tetrad.search.utils.MultiLayerPerceptron
The MultiLayerPerceptron class represents a simple feedforward neural network with one output and support for
multiple hidden layers. The network uses configurable activation functions and random initialization of weights and
biases.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiLayerPerceptron(int inputDim, int[] hiddenLayers, Function<Double, Double> activation, double inputScale, long seed) Constructor to initialize a random multi-layer perceptron. -
Method Summary
-
Constructor Details
-
MultiLayerPerceptron
public MultiLayerPerceptron(int inputDim, int[] hiddenLayers, Function<Double, Double> activation, double inputScale, long seed) Constructor to initialize a random multi-layer perceptron.- Parameters:
inputDim- Number of input dimensions (R^n).hiddenLayers- Array specifying the number of neurons in each hidden layer.activation- Activation function (e.g., Math::tanh or Math::sin).inputScale- Scaling factor for the input to create bumpiness.seed- Random seed for reproducibility.
-
-
Method Details
-
main
The main method serves as the entry point of the application. It demonstrates the usage of the MultiLayerPerceptron class by initializing a perceptron with specific parameters, processing sample input data, and outputting the computed results.- Parameters:
args- Command-line arguments provided to the application (not used in this implementation).
-
evaluate
public double evaluate(double[] x) Evaluates the MLP for a given input vector.- Parameters:
x- Input vector in R^n.- Returns:
- Output value in R.
-