Compare commits

...

4 commits

Author SHA1 Message Date
e62131ba1f Updated Main code 2025-03-17 10:15:02 -04:00
d7075bce86 Added config 2025-03-17 10:14:56 -04:00
891a608f6f Created network manager 2025-03-17 10:14:49 -04:00
d68f59aedd Moved BURN lib guide to neural 2025-03-17 10:14:38 -04:00
7 changed files with 72 additions and 1 deletions

21
project/src/config.rs Normal file
View file

@ -0,0 +1,21 @@
// Libraries
use std::env;
// Enums
pub enum OperationMode {
Training,
Infrence,
}
// Functions
pub fn get_operation_mode() -> Option<OperationMode> {
// Getting command line arguments
let args: Vec<String> = env::args().collect();
// Getting operation mode
match &args[1] {
"training" => Some(OperationMode::Training),
"infrence" => Some(OperationMode::Infrence),
_ => None,
}
}

View file

@ -1,6 +1,26 @@
// Libraries
mod config;
mod neural;
use neural::NeuralNetwork;
use std::error::Error;
// Entry-Point
fn main() {
println!("Hello, world!");
// Getting Running Mode First
let operation_mode = config::get_operation_mode();
// Creating a Neural Network
let neural: NeuralNetwork;
// Creating a Neural Network with the Operation Mode
match operation_mode {
None => panic!("Main: `OperationMode` not defined!"),
Some(mode) => {
neural = NeuralNetwork::new(mode);
}
}
// Starting the network
neural.start();
}

30
project/src/neural.rs Normal file
View file

@ -0,0 +1,30 @@
// Libraries
mod data;
mod infrence;
mod model;
mod training;
use super::config::OperationMode;
// Structures
pub struct NeuralNetwork {
mode: OperationMode,
}
// Implementaions
impl NeuralNetwork {
// Constructors
pub fn new(mode: OperationMode) -> Self {
// Return Result
Self { mode }
}
// Functions
pub fn start(&self) {
// Switching based on mode
match self.mode {
OperationMode::Training => {}
OperationMode::Infrence => {}
}
}
}