I'm pretty new to deep learning and neural networks and trying to implement an agent that would be able to play my simple game

[![game field](https://i.stack.imgur.com/pcOuo.png)](https://i.stack.imgur.com/pcOuo.png)

So the goal is to get the highest possible score (sum of cells visited) while reaching towards the destination (orange cell) within steps available (always gte distance from the player to the finish cell).

Model for my network is really simple (I'm using `tflearn`)

```
network = input_data(shape=[None, 13, 1], name='input')
network = fully_connected(
    network,
    13**2,
    activation='relu'
)
network = fully_connected(network, 1, activation='linear')
network = regression(
    network,
    optimizer='adam',
    learning_rate=self.lr,
    loss='mean_square',
    name='target',
)
model = tflearn.DNN(network, tensorboard_dir='log')

```

where `13` is a number of features I am able to extract from the game state. But the resulting model gives really bad behaviour when playing

```
[default] INFO:End the game with a score: 36
[default] INFO:Path: up,up,up,up,up,up,up,up,up,up,up,up,up,up,up

```

So I want to figure out what important parts I have missed and have some open questions to clarify:

```
Training Step: 3480  | total loss: 0.11609 | time: 4.922s
| Adam | epoch: 001 | loss: 0.11609 -- iter: 222665/222665

```

1. What is the loss value I'm looking for? Is there a rule of thumb that will tell me a loss is good enough?
2. How many epochs do I need to have? How to figure out the exact number of them?
3. What if my NN architecture is completely wrong and unsuitable for this task? How to spot that?
4. And finally: what is a good place to start when debugging your network and which aspects should I double-check and verify first.

I understand that this is a slightly open question and it might be inappropriate to post it here, so I'll appreciate any kind of guidance or general comments.