Skip to content

Commit

Permalink
Name change
Browse files Browse the repository at this point in the history
  • Loading branch information
patel-zeel committed Oct 27, 2023
1 parent ddcd518 commit 59d28b4
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 350 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: |
pytest -v --cov=SusML --cov-report term-missing
pytest -v --cov=astra --cov-report term-missing
coveralls --service=github
coveralls:
name: Finish coverage
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ __pycache__/
*.ipynb_checkpoints
*.pyc
*.egg-info/
SusML/_version.py
astra/_version.py

/.quarto/
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# SusML
# ASTRA
"**A**i for **S**ustainability" **T**oolkit for **R**esearch and **A**nalysis. ASTRA (अस्त्र) means "a weapon" in Sanskrit, Hindi and a few other Bharatiya languages.

![Python version](https://img.shields.io/badge/Python-3.9%2B-brightgreen)
![Build](https://img.shields.io/github/actions/workflow/status/sustainability-lab/SusML/build.yml?label=build&logo=github)
![Tests](https://img.shields.io/github/actions/workflow/status/sustainability-lab/SusML/tests.yml?label=tests&logo=github)
![Build](https://img.shields.io/github/actions/workflow/status/sustainability-lab/astra/build.yml?label=build&logo=github)
![Tests](https://img.shields.io/github/actions/workflow/status/sustainability-lab/astra/tests.yml?label=tests&logo=github)

# Install
```bash
pip install susml
pip install astra
```

# Useful Code Snippets

## Data
### Load Data
```python
from susml.torch.data import load_mnist, load_cifar_10
from astra.torch.data import load_mnist, load_cifar_10
ds, ds_name = load_cifar_10()
```

## Models
### Initialize MLPs
```python
from susml.torch.models import MLP
from astra.torch.models import MLP

mlp = MLP(input_dim=100, hidden_dims=[128, 64], output_dim=10, activation="relu", dropout=0.1)
```

### Initialize CNNs
```python
from susml.torch.models import CNN
from astra.torch.models import CNN
CNN(image_dim=32,
kernel_size=5,
n_channels=3,
Expand All @@ -39,14 +41,14 @@ CNN(image_dim=32,
## Training
### Quick train a model
```python
from susml.torch.utils import train_fn
from astra.torch.utils import train_fn
result = train(model, inputs, outputs, loss_fn, lr, n_epochs, batch_size, enable_tqdm=True)
print(result.keys()) # dict_keys(['epoch_losses', 'iter_losses'])
```

## Adhoc
### Count number of parameters in a model
```python
from susml.torch.utils import count_params
from astra.torch.utils import count_params
n_params = count_params(mlp)
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ requires = [
]

[tool.setuptools_scm]
write_to = "susml/_version.py"
write_to = "astra/_version.py"
Loading

0 comments on commit 59d28b4

Please sign in to comment.