Skip to main content

Neptune.ai fast.ai integration library

Project description

Neptune - fast.ai integration

See the official docs.

from fastai.basics import URLs, untar_data, accuracy
from fastai.tabular.all import tabular_learner, TabularDataLoaders, Categorify, FillMissing, Normalize
from fastai.callback.all import SaveModelCallback

from neptune import new as neptune
from neptune_fastai.impl import NeptuneCallback


neptune_run = neptune.init()

path = untar_data(URLs.ADULT_SAMPLE)

dls = TabularDataLoaders.from_csv(path / 'adult.csv',
                                  path=path,
                                  y_names="salary",
                                  cat_names=[
                                      'workclass',
                                      'education',
                                      'marital-status',
                                      'occupation',
                                      'relationship',
                                      'race'
                                  ],
                                  cont_names=['age', 'fnlwgt', 'education-num'],
                                  procs=[Categorify, FillMissing, Normalize])

learn = tabular_learner(dls,
                        metrics=accuracy)
learn.fit_one_cycle(10,
                    cbs=[
                            NeptuneCallback(run=neptune_run,
                                            base_namespace='experiment'),
                            SaveModelCallback(monitor='accuracy')
                        ])

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

neptune-fastai-0.10.1.tar.gz (24.7 kB view hashes)

Uploaded Source

Supported by

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