This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pomegranate import DiscreteDistribution, \ | |
ConditionalProbabilityTable, BayesianNetwork, State | |
def make_net() -> BayesianNetwork: | |
# midterm exam grade: either A or O (Other) | |
midterm = DiscreteDistribution({ | |
'A': 0.11, | |
'O': 0.89 | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NeuralNetwork(object): | |
"""Class which implements Neural Network | |
For now support single loss function L = 1/2 * (a2-y)^2 | |
For now support 3 activation functions: sigmoid, tanh, relu | |
Parameters | |
---------- | |
input_size: int, required | |
size of input layer |