Skip to content

Latest commit

 

History

History
142 lines (116 loc) · 3.51 KB

File metadata and controls

142 lines (116 loc) · 3.51 KB

"AI for Sustainability" Toolkit for Research and Analysis. ASTRA (अस्त्र) means a "tool" or "a weapon" in Sanskrit.

Design Principles

Since astra is developed for research purposes, we'd try to adhere to these principles:

What we will try to do:

  1. Keep the API simple-to-use and standardized to enable quick prototyping via automated scripts.
  2. Keep the API transparent to expose as many details as possilbe. Explicit should be preferred over implicit.
  3. Keep the API flexible to allow users to stretch the limits of their experiments.

What we will try to avoid:

  1. We will try not to reduce code repeatation at expence of transparency, flexibility and performance. Too much abstraction often makes the API complex to understand and thus becomes hard to adapt for custom use cases.

Examples

Points Example
1 and 2 We have exactly same arguments for all strategies in astra.torch.al.strategies to ease the automation but we explicitely mention in the docstrings if an argument is used or ignored for a strategy.
2 predict functions in astra by default put the model on eval mode but also allow to set eval_mode to False. This can be useful for techniques like MC dropout.
3 train_fn from astra.torch.utils works for all types of models and losses which may or may not be from astra.
4 Though F1 score can be computed from precision and recall, we explicitely use F1 score formula to allow transparency and to avoid computing TP multiple times.

Install

Stable version:

pip install astra-lib

Latest version:

pip install git+https://github.com/sustainability-lab/ASTRA

Contributing

Please go through the contributing guidelines before making a contribution.

Useful Code Snippets

Data

Load Data

{{ load_data }}
{{ load_data_output }}
{{ load_data_error }}

Models

MLPs

{{ mlp }}
{{ mlp_output }}
{{ mlp_error }}

CNNs

{{ cnn }}
{{ cnn_output }}
{{ cnn_error }}

EfficientNets

{{ efficientnet }}
{{ efficientnet_output }}
{{ efficientnet_error }}

ViT

{{ vit }}
{{ vit_output }}
{{ vit_error }}

Training

Train Function Usage

{{ quick_train }}
{{ quick_train_output }}
{{ quick_train_error }}

Train with DataLoader

{{ train_with_dataloader }}
{{ train_with_dataloader_output }}
{{ train_with_dataloader_error }}

Advanced Usage

{{ advanced_train }}
{{ advanced_train_output }}
{{ advanced_train_error }}

Others

Count number of parameters in a model

{{ count_params }}
{{ count_params_output }}
{{ count_params_error }}