-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
151 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: "Dry Run" | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
run_steps_from_readme: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
nn/target | ||
key: ${{ runner.os }}-cache | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
- name: Compile Rust Code | ||
run: | | ||
echo "Compiling Rust Code" | ||
pushd nn | ||
nix develop . --command cargo build --release | ||
popd | ||
- name: Generate Optimized Trajectories | ||
run: | | ||
echo "Generating Optimised Trajectories" | ||
pushd generate_data | ||
nix develop . --command env GENERATE_DATA_N_TRAJECTORIES=100 uv run quadcopter.py | ||
popd | ||
- name: Run Training | ||
run: | | ||
echo "Running Training" | ||
pushd nn | ||
nix develop . --command env TRAIN_USE_NDARRAY=1 cargo run --release --bin train | ||
popd | ||
- name: Run Inference | ||
run: | | ||
echo "Running Inference" | ||
pushd nn | ||
nix develop . --command env INFERENCE_USE_NDARRAY=1 cargo run --release --bin vis_results | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
use std::env; | ||
|
||
use train_quadcopter::training; | ||
|
||
use anyhow::Result; | ||
use burn::backend::ndarray::{NdArray, NdArrayDevice}; | ||
use burn::backend::wgpu::{Wgpu, WgpuDevice}; | ||
use burn::backend::Autodiff; | ||
|
||
fn main() -> Result<()> { | ||
println!("Quadcopter Training"); | ||
|
||
let device = WgpuDevice::default(); | ||
training::run::<Autodiff<Wgpu>>(device) | ||
if env::var("TRAIN_USE_NDARRAY").is_ok() { | ||
let device = NdArrayDevice::default(); | ||
training::run::<Autodiff<NdArray>>(device) | ||
} else { | ||
let device = WgpuDevice::default(); | ||
training::run::<Autodiff<Wgpu>>(device) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters