darts-toolkit

Differentiable Architecture Search Toolkit in PyTorch Lightning

https://github.com/jmaczan/darts-toolkit

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary

Keywords

artificial-intelligence darts deep-learning differentiable-architecture-search machine-learning nas neural-architecture-search pc-darts pcdarts pytorch pytorch-lightning research
Last synced: 6 months ago · JSON representation ·

Repository

Differentiable Architecture Search Toolkit in PyTorch Lightning

Basic Info
  • Host: GitHub
  • Owner: jmaczan
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 228 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
artificial-intelligence darts deep-learning differentiable-architecture-search machine-learning nas neural-architecture-search pc-darts pcdarts pytorch pytorch-lightning research
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

darts-toolkit

Differentiable Architecture Search Toolkit in PyTorch Lightning

[!TIP] Boost your research and use solid engineering practices out-of-the-box

Use this toolkit to:

  • Research your own DARTS algorithm with pre-built components and create your own components
  • Use existing DARTS architectures, like Partially-Connected Differentiable Architecture Search
  • Configure hyperparameters with yaml files
  • Scale to multiple GPUs with no effort
  • Visualize your neural network architecture

Examples

Find a network architecture for image recognition

```py from dartstoolkit.models import LPCDARTSLightningModule from dartstoolkit.data import CIFAR10DataModule from dartstoolkit.utils.yaml import loadconfig import yaml

Load configuration

config = load_config(os.path.join("src", "config.yaml"))

Create data module

data_module = CIFAR10DataModule(config)

Create model

model = LPCDARTSLightningModule(config)

Search phase

searchmodel = LPCDARTSLightningModule(config) searchtrainer = pl.Trainer( maxepochs=config["training"]["max_epochs"], accelerator="gpu" if config["training"].get("gpus") else "auto", devices=config["training"].get("gpus") or "auto", callbacks=[RichProgressBar()], logger=TensorBoardLogger( config["logging"]["log_dir"], name=f"{config['logging']['experiment_name']}search", ), )

Train the search model

searchtrainer.fit(searchmodel, data_module)

Test the search model

searchtrainer.test(searchmodel, datamodule=data_module) ```

Train a derived architecture

```py

Derive and train the final architecture

derivedarchitecture = searchmodel.derivearchitecture() derivedmodel = DerivedPCDARTSModel( derivedarchitecture=derivedarchitecture, config=config )

derivedtrainer = pl.Trainer( maxepochs=config["training"]["derivedepochs"], accelerator="gpu" if config["training"].get("gpus") else "auto", devices=config["training"].get("gpus") or "auto", callbacks=[ModelCheckpoint(monitor="valacc", mode="max"), RichProgressBar()], logger=TensorBoardLogger( config["logging"]["logdir"], name=f"{config['logging']['experiment_name']}derived", ), )

Train the derived model

derivedtrainer.fit( derivedmodel, traindataloaders=datamodule.traindataloader()["train"], valdataloaders=datamodule.valdataloader(), )

Test the derived model

derivedtrainer.test(derivedmodel, datamodule=data_module) ```

Install

Using pip:

sh pip install git+https://github.com/jmaczan/darts-toolkit.git

Using uv:

sh uv pip install git+https://github.com/jmaczan/darts-toolkit.git

Install (for development)

```sh git clone https://github.com/jmaczan/darts-toolkit.git cd darts-toolkit

Install using uv (recommended)

uv pip install -e .

Or install using pip

pip install -e . ```

Prerequisities

This project uses uv for package management

Also, it uses Ruff for formatting if you run the project in VS Code. You can install Ruff plugin by Astral Software from extensions marketplace and you're good to go

sh uv sync

Run

sh uv run python -m src.models.lightning_pc_darts

Cite

If you use this software in your research, please use the following citation:

bibtex @software{Maczan_PCDARTS_2024, author = {Maczan, Jędrzej Paweł}, title = {Differentiable Architecture Search Toolkit in PyTorch Lightning}, url = {https://github.com/jmaczan/darts-toolkit}, year = {2024}, publisher = {GitHub} }

License

GNU GPLv3

Author

Jędrzej Maczan, 2024

Owner

  • Name: Jędrzej Maczan
  • Login: jmaczan
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software in your research, please cite it as below."
authors:
  - family-names: "Maczan"
    given-names: "Jędrzej Paweł"
    orcid: "https://orcid.org/0000-0003-1741-6064"
title: "Differentiable Architecture Search Toolkit in PyTorch Lightning"
date-released: 2024-10-15
url: "https://github.com/jmaczan/darts-toolkit"

GitHub Events

Total
  • Watch event: 1
  • Push event: 41
Last Year
  • Watch event: 1
  • Push event: 41

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 95
  • Total Committers: 1
  • Avg Commits per committer: 95.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 95
  • Committers: 1
  • Avg Commits per committer: 95.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
jmaczan j****l@m****l 95
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi
  • lightning >=2.4.0
  • rich >=13.9.2
  • tensorboard >=2.18.0
  • torch >=2.4.1
  • torchvision >=0.19.1
setup.py pypi