Bellande training framework in Rust for machine learning models
use bellande_ai_training_framework::prelude::*;
fn main() -> Result<(), Box<dyn Error>> {
let mut framework = Framework::new()?;
framework.initialize()?;
// Create model
let model = Sequential::new()
.add(Conv2d::new(3, 64, 3, 1, 1))
.add(ReLU::new())
.add(Linear::new(64, 10));
// Configure training
let optimizer = Adam::new(model.parameters(), 0.001);
let loss_fn = CrossEntropyLoss::new();
let trainer = Trainer::new(model, optimizer, loss_fn);
// Train model
trainer.fit(train_loader, Some(val_loader), 100)?;
Ok(())
}
Bellande Artificial Intelligence Training Framework is distributed under the GNU General Public License v3.0, see LICENSE and NOTICE for more information.