An open API service indexing awesome lists of open source software.

https://github.com/rudrodip/timmygrad

scalar value gradient descent optimizer
https://github.com/rudrodip/timmygrad

backpropagation gradient-descent multilayer-perceptron-network neural-network numpy python3 pytorch

Last synced: 7 months ago
JSON representation

scalar value gradient descent optimizer

Awesome Lists containing this project

README

          

# Timmygrad

Timmygrad is a scalar value gradient descent optimizer for Python. It is designed to be simple and easy to use, with a focus on readability and understandability. It is not designed for performance, but rather for educational purposes.




this is timmy btw

Here is a simple Linear Regression example using Timmygrad:

```python
m = Value(0.0)
c = Value(0.0)

alpha = 0.01 # learning rate
epochs = 200

for epoch in range(epochs):
for x, y in zip(X, Y):
# forward pass
y_pred = m * x + c

# compute loss
loss = (y - y_pred) ** 2

# backward pass
loss.backward()

# update weights
m.data -= alpha * m.grad
c.data -= alpha * c.grad

# reset gradients
m.grad = 0
c.grad = 0
```