Skip to content

Commit

Permalink
docs: introduce README.md, remove outdated .md files
Browse files Browse the repository at this point in the history
  • Loading branch information
manoflearning committed Sep 13, 2024
1 parent 04132fa commit 2512feb
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 61 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 84 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,84 @@
Documentation is still in progress. If you're interested in Cranberry, feel free to join us and say hi in [our Discord channel](https://discord.gg/DKqZGpPJDV)!
<h1 align="center">Cranberry</h1>

<p align="center">
A lightweight deep learning framework in Rust and Python
</p>

<p align="center">
<a href="https://github.com/manoflearning/cranberry/actions/workflows/main.yaml">
<img src="https://github.com/manoflearning/cranberry/actions/workflows/main.yaml/badge.svg" alt="unit tests">
</a>
<a href="https://github.com/manoflearning/cranberry/stargazers">
<img src="https://img.shields.io/github/stars/manoflearning/cranberry" alt="github repo stars">
</a>
</p>
<p align="center">
<a href="https://discord.gg/DKqZGpPJDV">
<img src="https://dcbadge.limes.pink/api/server/https://discord.gg/DKqZGpPJDV" alt="discord server">
</a>
</p>


## Overview

Cranberry is a deep learning framework designed for efficiency and simplicity. It combines the performance of Rust with the flexibility of Python to create a powerful yet concise tool for machine learning practitioners and researchers.

### Current Status

Cranberry is in its early stages of development but is already functional for basic deep learning tasks. We are actively working on expanding its capabilities to make it a robust and practical framework for a wide range of applications.

### Key Features
- Minimal set of kernels implemented in Rust
- Majority of the framework logic implemented in Python for flexibility and ease of development
- Extremely concise codebase, making it easy to understand and extend
- PyTorch-like API for familiar and intuitive usage
- Designed for real-world applications while maintaining simplicity

## Getting Started

### Installation

```bash
git clone https://github.com/manoflearning/cranberry.git
cd cranberry
pip install poetry
poetry install
poetry run maturin develop
```

### Usage and Examples

```python
from cranberry import nn, optim
from cranberry.features.datasets import mnist

X_train, Y_train, X_test, Y_test = mnist()
X_train, X_test = X_train.flatten(1), X_test.flatten(1)

model = nn.Sequential(nn.Linear(784, 128), nn.ReLU(), nn.Linear(128, 64), nn.ReLU(), nn.Linear(64, 10))

optimizer = optim.SGD(model.parameters(), lr=0.001)

for i in range(100):
optimizer.zero_grad()
# forward
loss = model(X_train).sparse_categorical_crossentropy(Y_train)
# backward
loss.backward()
# update
optimizer.step()

print(f"epoch {i}, loss {loss.item():.4f}")
```

For more examples, see the [examples](./examples) directory.

## Contributing and Community

We welcome contributions to help Cranberry grow into a fully-featured, production-ready deep learning framework.

Join our [Discord server](https://discord.gg/DKqZGpPJDV) to discuss development, get help, or just hang out with us.

## License

Cranberry is released under the MIT License.
14 changes: 0 additions & 14 deletions docs/dev-guide.md

This file was deleted.

41 changes: 0 additions & 41 deletions docs/tensor-structure.md

This file was deleted.

2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pyright = "^1.1.372"
ruff = "^0.5.4"
pytest = "^8.3.1"
torch = "^2.3.1"
maturin = "^1.7.0"
maturin = "^1.7.1"

[tool.ruff]
line-length = 120
Expand All @@ -28,7 +28,7 @@ build-backend = "maturin"

[project]
name = "cranberry"
version = "0.1.1"
version = "0.1.2"
description = ""
authors = [ {name = "Wookyung Jeong", email = "77jwk0724@gmail.com"} ]
requires-python = "~=3.11"
Expand Down

0 comments on commit 2512feb

Please sign in to comment.