Categories
Misc

My Model doesn’t seem to be learning, and I can’t figure out why

For the record, I’m absolutely expecting to have made some obvious error here, but I can’t seem to find it myself.

For context, I have implemented a very simple version of a game similar to doodle jump, and among other things I have attempted to train a FFNN to predict the correct / best inputs based on the state of the game. I have generated ~15k examples through manual play, each frame having a 25% of being recorded for both state and inputs, and for a slight bit of dataset balancing, half of all frames without any input are discarded.

I’m using a sequential model with 3 dense layers, using 15, 5 and 3 units respectively. I’ve specified a sigmoid activation for the input and hidden layers, and the input shape for the input layer.

For each example, the input consists of 15 scalar values (7 pairs of values representing the distance of a platform to the player sprite in horizontal and vertical direction respectively, plus 1 value for the currently remaining timer. (I’m using a 20 second timer to make comparisons reasonable.)), while the labels consist of 3 integers, each either 1 or 0, representing whether the key associated with that position has been pressed on that frame or not. (Left, Right, Up in that order.) The model compilation specifies the use of the Adam optimzer and MeanSquaredError loss.

What I’m specifically hoping to predict is a set of 3 values, which I can check against a set threshold to determine wheter the associated key should be pressed on that frame.

When training the model, however, I’m seeing no relevant drop in loss over 100 epochs, (most recently it went from 0.1923 to 0.1901), and indeed the trained models behaviour will consistently see it pressin right and jump, with the value for the left key often being negative, which on the one hand seems to indicate extreme underfitting (Since it’s predicting negative values when all example labels were positive), but on the other the sheer regularity with which this occurs might point to an error in my methodology.

I realise that any answer to this will be speculative at best, and that’s absolutely fine. I’ve tried everything I can think of (Varying number and size of the layers, varying the optimizer and/or loss function, varying the threshold, deleting and rebuilding the dataset…), so any ideas wouldbe very welcome.

submitted by /u/Rhoderick
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *