Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training #202

Merged
merged 21 commits into from
Jul 6, 2024
Merged

Training #202

merged 21 commits into from
Jul 6, 2024

Conversation

decahedron1
Copy link
Member

@decahedron1 decahedron1 commented May 20, 2024

Support for the Training API.

for (inputs, labels) in dataset {
	let outputs = trainer.step(ort::inputs![inputs]?, ort::inputs![labels]?)?;
	let loss: ArrayView0<f32> = outputs[0].try_extract_tensor::<f32>()?.into_dimensionality().unwrap();
	println!("{}", loss.into_scalar());
	optimizer.step()?;
	optimizer.reset_grad()?;
}

TODO

  • Documentation + examples
  • Complete API
  • HF-like Trainer API
  • Add build pipeline 🙃

@decahedron1 decahedron1 added enhancement New feature or request needs testing relevant feature is implemented but needs further testing/debugging v2 Issue with ort v2 labels May 20, 2024
@decahedron1 decahedron1 self-assigned this May 20, 2024
@decahedron1 decahedron1 mentioned this pull request Jun 19, 2024
@decahedron1 decahedron1 marked this pull request as ready for review June 30, 2024 18:20
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 5.71429% with 132 lines in your changes missing coverage. Please review.

Project coverage is 44.45%. Comparing base (dc79ade) to head (8a0646c).

Files Patch % Lines
src/training/simple.rs 0.00% 84 Missing ⚠️
src/training/trainer.rs 0.00% 48 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #202      +/-   ##
==========================================
- Coverage   47.58%   44.45%   -3.14%     
==========================================
  Files          27       30       +3     
  Lines        1839     1973     +134     
==========================================
+ Hits          875      877       +2     
- Misses        964     1096     +132     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@decahedron1 decahedron1 merged commit 0a43482 into main Jul 6, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs testing relevant feature is implemented but needs further testing/debugging v2 Issue with ort v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants