9 releases (breaking)
Uses new Rust 2024
new 0.7.0 | Mar 24, 2025 |
---|---|
0.6.0 | Feb 20, 2025 |
0.5.0 | Apr 9, 2024 |
0.4.1 | Apr 2, 2024 |
0.1.0 | Jan 15, 2024 |
#24 in Simulation
131 downloads per month
Used in 3 crates
440KB
7K
SLoC
AmfiRL
Framework library for reinforcement learning using data model from amfi
crate.
Crate contains traits and generic implementation.
Torch dependency
This crate depends on tch
which requires that you have Torch
installed.
Use guide provided by that crate.
For me the procedure looks like this:
- Unpacking compiled
torchlib
for C++/Java; You will get structure like this:
/path/to/libtorch
| -- bin
| -- include
| -- lib
| ...
- Set your environment variables:
export LIBTORCH=/path/to/torch
export LD_LIBRARY_PATH=/path/to/libtorch/lib
CUDA support
This crate tries to support CUDA backed tensor operations.
It might be necessary to add following code in build.rs
script in your crate:
fn main() {
let os = std::env::var("CARGO_CFG_TARGET_OS").expect("Unable to get TARGET_OS");
match os.as_str() {
"linux" | "windows" => {
if let Some(lib_path) = std::env::var_os("DEP_TCH_LIBTORCH_LIB") {
println!("cargo:rustc-link-arg=-Wl,-rpath={}", lib_path.to_string_lossy());
}
println!("cargo:rustc-link-arg=-Wl,--no-as-needed");
println!("cargo:rustc-link-arg=-Wl,--copy-dt-needed-entries");
println!("cargo:rustc-link-arg=-ltorch");
}
_ => {}
}
}
It solved CUDA backend problem for me link to source.
Examples
Examples are presented in separate crate - amfiteatr_examples
Licence: MIT
Dependencies
~16MB
~314K SLoC