Package edu.cmu.tetrad.search.utils
Class MultiLayerPerceptronFunction1D
java.lang.Object
edu.cmu.tetrad.search.utils.MultiLayerPerceptronFunction1D
This class implements a 1-dimensional Multi-Layer Perceptron (MLP) function. It consists of a single hidden layer and
scales the input to introduce variability or "bumpiness" as needed. The activation function for the hidden layer and
weights/biases for the neural network are initialized during construction.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiLayerPerceptronFunction1D(int hiddenDimension, double inputScale, Function<Double, Double> activation, long seed) Constructor to initialize a random function. -
Method Summary
Modifier and TypeMethodDescriptiondoubleevaluate(double x) Evaluates the random function for a given input.static voidThe entry point of the application that demonstrates the usage of the MultiLayerPerceptronFunction1D class by defining a random function with specific parameters and evaluating it over a range of inputs.
-
Constructor Details
-
MultiLayerPerceptronFunction1D
public MultiLayerPerceptronFunction1D(int hiddenDimension, double inputScale, Function<Double, Double> activation, long seed) Constructor to initialize a random function.- Parameters:
hiddenDimension- Number of neurons in the hidden layer.inputScale- Scaling factor for the input to create bumpiness.activation- Activation function (e.g., Math::sin or Math::tanh).seed- Random seed for reproducibility.
-
-
Method Details
-
main
The entry point of the application that demonstrates the usage of the MultiLayerPerceptronFunction1D class by defining a random function with specific parameters and evaluating it over a range of inputs.- Parameters:
args- Command-line arguments passed to the program.
-
evaluate
public double evaluate(double x) Evaluates the random function for a given input.- Parameters:
x- Input value in R.- Returns:
- Output value in R.
-