skka3134

skka3134

email
telegram

Unity Reinforcement Learning: Snake

image

Reinforcement learning and deep learning are subsets of machine learning.

The main differences between reinforcement learning and deep learning are:

  1. Deep learning uses labeled training samples, while reinforcement learning does not. It learns through rewards and punishments provided by the environment.
  2. The learning process of deep learning is static, while the learning process of reinforcement learning is dynamic. The difference between static and dynamic here is whether there is interaction with the environment. Deep learning learns from the given samples, while reinforcement learning interacts with the environment and learns from the rewards and punishments provided by the environment.
  3. Deep learning is mainly used to solve perception problems, while reinforcement learning is mainly used to solve decision-making problems. Therefore, deep learning is more like the senses, while reinforcement learning is more like the brain.

ML-Agents is an open-source Unity plugin that allows us to train intelligent agents in game and simulation environments.

  1. Download ML-Agents, don't ask me why I'm not using version 20.
    https://github.com/Unity-Technologies/ml-agents/releases/tag/release_19
  2. Download Conda (Python environment).
    https://anaconda.org/anaconda/conda
  3. Create a Conda environment.
conda create -n base1 python=3.8
  1. Switch to the created environment.
conda activate base1
  1. Install ML-Agents.
cd C:\Users\546546\Desktop\ml-agents-release_19\ml-agents-release_19
pip install torch~=1.7.1
pip install -e./ml-agents-envs
pip install -e./ml-agents
pip uninstall protobuf
pip install protobuf==3.19.6
pip uninstall numpy
pip install numpy==1.19
  1. After completing the development of the game logic, start training.
mlagents-learn config/ppo/ball.yaml --run-id=t1

You can find detailed tutorials on my YouTube channel.
https://www.youtube.com/watch?v=eNQpujBpGMY&t=13s

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.