Skip to main content

A library to make neural networks lighter and faster with fastai

Project description

Fasterai

header

fasterai is a library created to make neural network smaller and faster. It essentially relies on common compression techniques for networks such as pruning, knowledge distillation, ...

Project Documentation

Visit Read The Docs Project Page or read following README to know more about using Fasterai

Available Methods

1. Pruning

Make your model sparse (i.e. prune it) according to a:

  • Sparsity: the amount of weights that will be replaced by 0
  • Granularity: the granularity at which you operate the pruning (removing weights, vectors, kernels, filters)
  • Method: prune either each layer independantly (local pruning) or the whole model (global pruning)
  • Criteria: the criteria used to select the weights to remove (magnitude, movement, ...)
  • Schedule: which schedule you want to use for pruning (one shot, iterative, gradual, ...)

2. Knowledge Distillation

Distill the knowledge acquired by a big model into a smaller one.

3. Lottery Ticket Hypothesis

Find the winning ticket in you network, i.e. the initial subnetwork able to attain at least similar performances than the network as a whole.

Quick Start

1. Create your model with fastai

learn = cnn_learner(dls, model)

2. Get you Fasterai Callback

sp_cb=SparsifyCallback(end_sparsity, granularity, method, criteria, sched_func)

3. Train you model to make it sparse !

learn.fit_one_cycle(n_epochs, cbs=sp_cb)

More about other methods in the tutorials section

Installation

pip install git+https://github.com/nathanhubens/fasterai.git

or

pip install fasterai

Citing

@misc{Hubens:2020,
  Author = {Nathan Hubens},
  Title = {Fasterai},
  Year = {2020},
  Publisher = {GitHub},
  Journal = {GitHub repository},
  Howpublished = {\url{https://github.com/nathanhubens/fasterai}}
}

footer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fasterai-0.1.2.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fasterai-0.1.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file fasterai-0.1.2.tar.gz.

File metadata

  • Download URL: fasterai-0.1.2.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for fasterai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ff44ca5743b8ea0fcfdb70c854b56ffa36050f56682890f78d40434685812a8e
MD5 6352393522351e2a536d12fee0d67913
BLAKE2b-256 1e238b716081d413ed2eefc27fac15e25639d5e18c3cffa70f20b8e754dd94c7

See more details on using hashes here.

File details

Details for the file fasterai-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fasterai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for fasterai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d38dc7537de97924af1097783780dcd0c616fc21e1549ab67e0aabe49b686987
MD5 552fb041abd4be9978e7f83056476aa5
BLAKE2b-256 69aaacd520f6c9a963f40ea93a4b34db6933a1bfac15c44f2d3ea52b4a883634

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page