![]() |
VOOZH | about |
SoftmaxLayer executes the softmax distribution from the given input dataset. We can build the network with input, hidden, and output layers using buildNetwork() function and we have used the hidden class as SoftmaxLayer to check the AND and NOR table values of the dataset. Below is the syntax to import SoftmaxLayer and usage in the code.
Syntax:
Import SoftmaxLayer: from pybrain.structure import SoftmaxLayer
Usage in python code: net= buildNetwork(1, 2, 1, bias=True, hiddenclass=SoftmaxLayer)
Example 1:
Output:
👁 ImageExample 2:
In this example, we have taken the sample dataset in AND table are ((0,0), (0,)) and ((0,1),(1,)) and NOR table are ((0,0),(1,)) and (0,1),(1,)) and then training starts to train this network using 2500 iterations and finally testing starts. We can see the testing output with average errors, max errors, median errors, etc.
Output:
👁 Image