Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C++ implementation of Proximal Policy Optimization

NotificationsYou must be signed in to change notification settings

mhubii/ppo_libtorch

Repository files navigation

This is an implementation of theproximal policy optimization algorithm for the C++ API of Pytorch. It uses a simpleTestEnvironment to test the algorithm. Below is a small visualization of the environment, the algorithm is tested in.

Fig. 1: The agent in testing mode.

Build

You first need to install PyTorch. For a clean installation from Anaconda, checkout this shorttutorial, or thistutorial, to only install the binaries.

Do

mkdir buildcd buildcmake -DCMAKE_PREFIX_PATH=/absolut/path/to/libtorch ..make

Run

Run the executable with

cd build./train_ppo

To plot the results, run

cd ..python plot.py --online_view --csv_file data/data.csv --epochs 1 10

It should produce something like shown below.

Fig. 2: From left to right, the agent for successive epochs in training mode as it takes actions in the environment to reach the goal.

The algorithm can also be used in test mode, once trained. Therefore, run

cd build./test_ppo

To plot the results, run

cd ..python plot.py --online_view --csv_file data/data_test.csv --epochs 1

Visualization

The results are saved todata/data.csv and can be visualized by runningpython plot.py. Run

python plot.py --help

for help.

About

C++ implementation of Proximal Policy Optimization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp