https://github.com/nonkloq/nn_dqn-from-scratch
Artificial Neural Network (MLP) and Deep Q-Learning Implementation from scratch, only using numpy.
https://github.com/nonkloq/nn_dqn-from-scratch
custom-gym-environment deepqlearning dqn-from-scratch dqn-tensorflow neural-network neural-networks-from-scratch
Last synced: about 1 year ago
JSON representation
Artificial Neural Network (MLP) and Deep Q-Learning Implementation from scratch, only using numpy.
- Host: GitHub
- URL: https://github.com/nonkloq/nn_dqn-from-scratch
- Owner: nonkloq
- License: gpl-3.0
- Created: 2023-04-14T19:24:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-05T12:50:33.000Z (over 2 years ago)
- Last Synced: 2025-03-26T00:36:12.919Z (over 1 year ago)
- Topics: custom-gym-environment, deepqlearning, dqn-from-scratch, dqn-tensorflow, neural-network, neural-networks-from-scratch
- Language: Jupyter Notebook
- Homepage:
- Size: 278 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Artificial Neural Network and Deep Q-Learning Network from Scratch
Implementation of a Neural Network (MLP) and Deep Q-Learning Network (DQN) using only the numpy library. The DQN is trained to play the Cartpole game.
## Multilayered Perceptron (ANN)
### Neural Network Construction: [Notebook](nn-mlp_from_scratch.ipynb)
This notebook provides a step-by-step procedure for constructing a multilayered perceptron.
### Neural Network Implementation: [NeuralNetwork](nn.py)
This file contains the full implementation of the neural network, with added momentum to the weight updating step. To save and load the `NeuralNetwork`, use `save_network` and `load_network` from [saveload.py](saveload.py).
## Deep Q-Learning Network
### Train DQN to Play Cartpole: [Notebook](dqn_from_scratch.ipynb)
This notebook demonstrates how to use the `NeuralNetwork` to implement the DQN algorithm.
### Custom Gym Environment
**Maze Harvest:** [Environment](maze_harvest.py)
> Check the Agent Training Notebook to learn more about the environment.
### DQN Using TensorFlow to Play Maze Harvest
**DQN Using TensorFlow:** [DQN](dqn_tf.py)
**Agent Training:** [Notebook](maze_harvest_train_tf.ipynb)
### Networks Folder
This folder contains pre-trained networks. Refer to the notebooks to learn how to load and use the networks.
## License
This project is licensed under the terms of the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.