mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 18:48:51 +00:00

* added policy_gradient, modified main, ddpg and README * fixed typo in README * removed unnecessary imports * small refactor * Use clap for picking up the subcommand to run. --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
38 lines
578 B
Rust
38 lines
578 B
Rust
#![allow(unused)]
|
|
|
|
#[cfg(feature = "mkl")]
|
|
extern crate intel_mkl_src;
|
|
|
|
#[cfg(feature = "accelerate")]
|
|
extern crate accelerate_src;
|
|
|
|
use candle::Result;
|
|
use clap::{Parser, Subcommand};
|
|
|
|
mod gym_env;
|
|
mod vec_gym_env;
|
|
|
|
mod ddpg;
|
|
mod policy_gradient;
|
|
|
|
#[derive(Parser)]
|
|
struct Args {
|
|
#[command(subcommand)]
|
|
command: Command,
|
|
}
|
|
|
|
#[derive(Subcommand)]
|
|
enum Command {
|
|
Pg,
|
|
Ddpg,
|
|
}
|
|
|
|
fn main() -> Result<()> {
|
|
let args = Args::parse();
|
|
match args.command {
|
|
Command::Pg => policy_gradient::run()?,
|
|
Command::Ddpg => ddpg::run()?,
|
|
}
|
|
Ok(())
|
|
}
|