aadya940 / chainopy

ChainoPy: A Python Library for Discrete Time Markov Chain based stochastic analysis
https://chainopy.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
13 stars 1 forks source link

Bad results with 3 state Markov Chain Neural Network #28

Open s-agapov opened 4 days ago

s-agapov commented 4 days ago

Hello. Interesting work, but I am having trouble reproducing your results.

The code from example notebook:

_markov_chain = MarkovChain(
        [[0.3, 0.5, 0.2], 
         [0.1, 0.8, 0.1], 
         [0.3, 0.3, 0.4]],

        states=["Rainy", "Sunny", "Cloudy"],
)

model = MarkovChainNeuralNetwork(_markov_chain, num_layers=5)
model.train_model(
                  num_samples=30_000, 
                  epochs=1000, 
                  learning_rate=0.1, 
                  momentum=0.9, 
                  verbose=False, 
                  patience=500, 
                  factor=0.5
                )

Almost all time loss > 0.7 and results too bad. image

aadya940 commented 3 days ago

Hey @s-agapov , Thank you for opening an issue!

Unfortunately, gradient descent is not deterministic in nature. Can you try running this a couple of times?