Skip to content

Commit

Permalink
v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellShibilski-Unkel committed Nov 26, 2024
1 parent 10966fe commit b2fd405
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 32 deletions.
69 changes: 37 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
# RustML
Open-source AI Library for Rust <br />
__v1.1__

## About
`RustML` is an AI/machine learning library built for the `Rust` programming language. It's desgined to work similarly to `Python` libraries, such as PyTorch & Tensorflow.

## Current Functions & Features
- Sigmoid function
```rust
Sigmoid(x: f64) -> f64
```

- ReLU function
```rust
ReLU(x: f64) -> f64
```

- Softmax function
```rust
Softmax(x: &[f64]) -> f64
```

- RNN algoritm
```rust
RNN(x: &[f64], y: &[f64], weights: &[f64], bias: f64) -> Vec<f64>
```

- LSTM algoritm
```rust
LSTM(x: &[f64], y: &[f64], weights: &[f64]) -> Vec<f64>
```
# RustML
Open-source AI Library for Rust <br />
__v1.1__

## About
`RustML` is an AI/machine learning library built for the `Rust` programming language. It's desgined to work similarly to `Python` libraries, such as PyTorch & Tensorflow.

## Current Functions & Features
- Sigmoid function
```rust
Sigmoid(x: f64) -> f64
```

- ReLU function
```rust
ReLU(x: f64) -> f64
```

- Softmax function
```rust
Softmax(x: &[f64]) -> f64
```

- RNN algoritm
```rust
RNN(x: &[f64], y: &[f64], weights: &[f64], bias: f64) -> Vec<f64>
```

- LSTM algoritm
```rust
LSTM(x: &[f64], y: &[f64], weights: &[f64]) -> Vec<f64>
```

- Gradient
```rust
gradient(x: f64, y: f64, loss: f64) -> f64
```
4 changes: 4 additions & 0 deletions src/rustml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ impl RustML {
exp_x.iter().map(|&v| v as f64 / sum_exp_x as f64).sum()
}

pub fn gradient(x: f64, y: f64, loss: f64) -> f64 {
2.0 * x * (loss - y)
}

pub fn ReLU(x: f64) -> f64 {
x.max(0.0)
}
Expand Down

0 comments on commit b2fd405

Please sign in to comment.