0

I`m beggener in time series neural networks "LSTM" , I'm using it with pythonnet in visual studio, but I've tried a lot in training to no avail where the accuracy never increases , it's very small and loss function is nan . Is this from data or network architecture ? anyone can help ?

            var trainx_data_numpy = data.trainX.reshape(218 , 201 , 1 );


            var trainY_data_numpy = data.trainY.reshape(218, 201, 1);
        
            var model = new Sequential();
            
            model.Add(new LSTM(128, activation: "relu", input_shape: new Shape(
                data.inputDimention.FD,
                data.inputDimention.SD) 
                , return_sequences: true
                ));
        model.Add(new Dropout(0.6));
        model.Add(new LSTM(128 , return_sequences: true));
        model.Add(new Dropout(0.6));
        model.Add(new LSTM(128));
       
        model.Add(new Dense(1));


        model.Compile(optimizer: "adam" , loss: "mse", metrics: new string[] { "accuracy" });

         var result =  model.Fit(trainx_data_numpy,
                trainY_data_numpy, batch_size: 1, 
                epochs: 10, verbose: 1 , validation_split:0.1f);
  • 1
    post the whole code. – Abhishek Prajapat Aug 06 '21 at 21:12
  • @AbhishekPrajapat I post my code , can you give some ideas obout my problem . – sharstan battal Aug 07 '21 at 15:09
  • I can't help in this case but for anyone who can you should always post your code for him to see. If he can't even see the code he won't know what you have done wrong. According to him, there could be 100 reasons for something going wrong but which one is it in your case, that he will know from your code. – Abhishek Prajapat Aug 07 '21 at 16:26

0 Answers0