<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/neptune-logo-less-margin-e1611939742683.png" width="400" /><br><br>
</div>

[![PyPI version](https://badge.fury.io/py/neptune-client.svg)](https://badge.fury.io/py/neptune-client)
[![Build Status](https://travis-ci.org/neptune-ai/neptune-client.svg?branch=master)](https://travis-ci.org/neptune-ai/neptune-client)
[![neptune-blog](https://img.shields.io/badge/Neptune-blog-informational?logo=data:image/png;base64, )](https://neptune.ai/blog)
[![twitter](https://img.shields.io/twitter/follow/neptune_ai.svg?label=Follow)](https://twitter.com/neptune_ai)
![youtube](https://img.shields.io/youtube/views/9iX6DxcijO8?style=social)

# Lightweight experiment tracking tool for AI/ML individuals and teams. Fits any workflow.
Neptune is a lightweight experiment logging/tracking tool that helps you with your machine learning experiments. Neptune is suitable for **indvidual**, **commercial** and **research** projects.  

### [Get free account](https://neptune.ai/register)

<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/lightning_adv_grad_norm.png" width="600" /><br><br>
</div>

# Features to help you get the job done
* Rich experiment logging and tracking capabilities
* Python and R clients
* Experiments dashboards, views and comparison features
* Team management
* 25+ integrations with popular data science stack libraries
* Fast, reliable UI

### [Documentation](https://docs.neptune.ai/index.html)

# Neptune in 30 seconds
<div align="center">
  <a href="https://youtu.be/9iX6DxcijO8" target="_blank">
    <img border="0" alt="W3Schools" src="https://neptune.ai/wp-content/uploads/yt-get-started.png" width="600">
  </a>
</div>

## Installation
```bash
pip install neptune-client
``` 

or

```bash
conda install -c conda-forge neptune-client
```

## Start tracking
For the hands-on intro to neptune-client check this API Tour, below simple example is presented:

[![github-code](https://img.shields.io/badge/GitHub-code-informational?logo=github)](https://github.com/neptune-ai/neptune-examples/blob/master/product-tours/how-it-works/docs/Neptune-API-Tour.py)
[![jupyter-code](https://img.shields.io/badge/Jupyter-code-informational?logo=jupyter)](https://github.com/neptune-ai/neptune-examples/blob/master/product-tours/how-it-works/showcase/Neptune-API-Tour.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neptune-ai/neptune-examples/blob/master/product-tours/how-it-works/showcase/Neptune-API-Tour.ipynb)

```python
import neptune

neptune.init('my_workspace/my_project')
neptune.create_experiment()

for epoch in range(train_epochs):
    ...
    neptune.log_metric('loss', loss)
    neptune.log_metric('metric', accuracy)

score = ...

neptune.log_metric('val_score', score)
neptune.log_artifact('model_weights.pth')
```

# What is Neptune good for?
Neptune can especially helpful with the following problems:

* [Logging runs metadata](https://docs.neptune.ai/user-guides/logging-and-managing-runs-results)
* [Monitoring ML runs live](https://docs.neptune.ai/getting-started/quick-starts/how-to-monitor-ml-runs-live-step-by-step-guide)
* [Organizing and exploring runs](https://docs.neptune.ai/user-guides/organizing-and-exploring-results-in-the-ui)
* [Comparing/debugging ML runs and models](https://docs.neptune.ai/user-guides/organizing-and-exploring-results-in-the-ui/comparing-runs)
* [Sharing results of experiments with your team/departament](https://docs.neptune.ai/user-guides/sharing-results-and-models-with-the-team)

# Use Neptune with your favourite AI/ML libraries
![frameworks-logos](https://neptune.ai/wp-content/uploads/framework-logos.png)

Neptune comes with **25+ integrations** with Python libraries popular in machine learning, deep learning and reinforcement learning.

Integrations lets you automatically:

* log training, validation and testing metrics, and visualize them in Neptune UI,
* log experiment hyper-parameters,
* monitor hardware usage,
* log performance charts and images,
* save model checkpoints,
* log interactive visualizations,
* log csv files, pandas Datraframes,
* [log much more](https://docs.neptune.ai/user-guides/logging-and-managing-runs-results/logging-runs-data#what-objects-can-you-log-to-neptune).

### [All integrations](https://docs.neptune.ai/essentials/integrations)

## PyTorch Lightning
<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/PyTorch-blue.png" width="400" /><br><br>
</div>

PyTorch Lightning is a lightweight PyTorch wrapper for high-performance AI research. You can automatically log PyTorch Lightning experiments to Neptune using `NeptuneLogger` (part of the pytorch-lightning library).

Example:
```python
from pytorch_lightning.loggers.neptune import NeptuneLogger

# Create NeptuneLogger
neptune_logger = NeptuneLogger(
    api_key="ANONYMOUS",
    project_name="shared/pytorch-lightning-integration",
    params=PARAMS)

# Pass NeptuneLogger to the Trainer
trainer = pl.Trainer(max_epochs=PARAMS['max_epochs'],
                     logger=neptune_logger)

# Fit model, have everything logged automatically
model = LitModel()
trainer.fit(model, train_loader)
```

[![neptune-pl](https://img.shields.io/badge/PytorchLightning-experiment-success?logo=data:image/png;base64, )](https://ui.neptune.ai/o/shared/org/pytorch-lightning-integration/e/PYTOR-137930/charts)

Check full code example:

[![github-code](https://img.shields.io/badge/GitHub-code-informational?logo=github)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/pytorch-lightning/docs/Neptune-PyTorch-Lightning-advanced.py)
[![jupyter-code](https://img.shields.io/badge/Jupyter-code-informational?logo=jupyter)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/pytorch-lightning/showcase/Neptune-PyTorch-Lightning-advanced.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neptune-ai/neptune-examples/blob/master/integrations/pytorch-lightning/showcase/Neptune-PyTorch-Lightning-advanced.ipynb)

## TensorFow/Keras
<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/keras_metrics-3.png" width="400" /><br><br>
</div>

TensorFlow is an open source deep learning framework commonly used for building neural network models. Keras is an official higher level API on top of TensorFlow. Neptune helps with keeping track of model training metadata.

Neptune integrates with both TensorFlow / Keras directly and via TensorBoard.

Example:
```python
import neptune
import tensorflow as tf
from neptunecontrib.monitoring.keras import NeptuneMonitor

neptune.init(api_token='ANONYMOUS', project_qualified_name='my_workspace/my_project')
neptune.create_experiment('tensorflow-keras-quickstart')

x_train, x_test = ...
model = tf.keras.models.Sequential([
  ...
])
optimizer = tf.keras.optimizers.SGD(lr=0.005, momentum=0.4,)
model.compile(optimizer=optimizer,
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])
model.fit(x_train, y_train,
          epochs=5,
          batch_size=64,
          callbacks=[NeptuneMonitor()])
```

[![neptune-pl](https://img.shields.io/badge/TF/Keras-experiment-success?logo=data:image/png;base64, )](https://ui.neptune.ai/o/shared/org/tensorflow-keras-integration/e/TEN-3505/charts)

Check full code example:

[![github-code](https://img.shields.io/badge/GitHub-code-informational?logo=github)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/tensorflow-keras/docs/Neptune-TensorFlow-Keras.py)
[![jupyter-code](https://img.shields.io/badge/Jupyter-code-informational?logo=jupyter)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/tensorflow-keras/showcase/Neptune-TensorFlow-Keras.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com//github/neptune-ai/neptune-examples/blob/master/integrations/tensorflow-keras/docs/Neptune-TensorFlow-Keras.ipynb)

## Use with Scikit-learn
<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/1200px-Scikit_learn_logo_small.svg.png" width="400" /><br><br>
</div>

Scikit-learn is an open source machine learning framework commonly used for building predictive models. Neptune helps with keeping track of model training metadata.

Example:
```python
import neptune
from neptunecontrib.monitoring.sklearn import log_regressor_summary

neptune.init('my_workspace/my_project')
neptune.create_experiment(params=parameters,
                          name='regression-example',
                          tags=['RandomForestRegressor', 'regression'])

rfr = RandomForestRegressor(**parameters)
X, y = load_boston(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=28743)
rfr.fit(X_train, y_train)

log_regressor_summary(rfr, X_train, X_test, y_train, y_test)
```

[![neptune-pl](https://img.shields.io/badge/sklearn-experiment-success?logo=data:image/png;base64, )](https://ui.neptune.ai/o/shared/org/sklearn-integration/e/SKLEARN-632/artifacts)

Check full code example:

[![github-code](https://img.shields.io/badge/GitHub-code-informational?logo=github)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/sklearn/docs/Neptune-Scikit-learn.py)
[![jupyter-code](https://img.shields.io/badge/Jupyter-code-informational?logo=jupyter)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/sklearn/showcase/Neptune-Scikit-learn.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com//github/neptune-ai/neptune-examples/blob/master/integrations/sklearn/docs/Neptune-Scikit-learn.ipynb)

## Use with LightGBM
<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/Lightgbm_logo_nobg.png" width="400" /><br><br>
</div>

LightGBM is a popular gradient boosting library.

Example:
```python

import lightgbm as lgb
import neptune
from neptunecontrib.monitoring.lightgbm import neptune_monitor

neptune.init('my_project/my_workspace')
neptune.create_experiment()

X_train, X_test, y_train, y_test = ...
lgb_train = lgb.Dataset(X_train, y_train)
lgb_eval = lgb.Dataset(X_test, y_test, reference=lgb_train)

params = {'boosting_type': 'gbdt',
          'objective': 'multiclass',
          'num_class': 3,
          'num_leaves': 31,
          'learning_rate': 0.05,
          'feature_fraction': 0.9
          }

gbm = lgb.train(params,
    lgb_train,
    num_boost_round=500,
    valid_sets=[lgb_train, lgb_eval],
    valid_names=['train','valid'],
    callbacks=[neptune_monitor()],
    )
```

[![neptune-pl](https://img.shields.io/badge/LightGBM-experiment-success?logo=data:image/png;base64, )](https://ui.neptune.ai/o/shared/org/LightGBM-integration/e/LGBM-71/artifacts)

Check full code example:

[![github-code](https://img.shields.io/badge/GitHub-code-informational?logo=github)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/lightgbm/docs/Neptune_lightGBM.py)
[![jupyter-code](https://img.shields.io/badge/Jupyter-code-informational?logo=jupyter)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/lightgbm/showcase/Neptune_lightGBM.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com//github/neptune-ai/neptune-examples/blob/master/integrations/lightgbm/docs/Neptune_lightGBM.ipynb)

## Use with Optuna
<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/optuna-logo.png" width="400" /><br><br>
</div>

Optuna is an open source hyperparameter optimization framework to automate hyperparameter search.

Example:
```python
import neptune
import lightgbm as lgb
import optuna
import neptunecontrib.monitoring.optuna as opt_utils

def objective(trial):
    data, target = load_breast_cancer(return_X_y=True)
    train_x, test_x, train_y, test_y = train_test_split(data, target, test_size=0.25)
    dtrain = lgb.Dataset(train_x, label=train_y)

    param = {'verbose': -1,
             'objective': 'binary',
             'metric': 'binary_logloss',
             'num_leaves': trial.suggest_int('num_leaves', 2, 256),
             'feature_fraction': trial.suggest_uniform('feature_fraction', 0.2, 1.0),
             'bagging_fraction': trial.suggest_uniform('bagging_fraction', 0.2, 1.0),
             'min_child_samples': trial.suggest_int('min_child_samples', 3, 100)}

    gbm = lgb.train(param, dtrain)
    preds = gbm.predict(test_x)
    accuracy = roc_auc_score(test_y, preds)

    return accuracy

neptune.init('my_workspace/my_project')
neptune.create_experiment('optuna-sweep')

neptune_callback = opt_utils.NeptuneCallback()

study = optuna.create_study(direction='maximize')
study.optimize(objective, n_trials=100, callbacks=[neptune_callback])
```

[![neptune-pl](https://img.shields.io/badge/optuna-experiment-success?logo=data:image/png;base64, )](https://ui.neptune.ai/o/shared/org/optuna-integration/e/OP-9150/charts)

Check full code example:

[![github-code](https://img.shields.io/badge/GitHub-code-informational?logo=github)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/optuna/docs/Neptune-Optuna.py)
[![jupyter-code](https://img.shields.io/badge/Jupyter-code-informational?logo=jupyter)](https://github.com/neptune-ai/neptune-examples/blob/master/integrations/optuna/showcase/Neptune-Optuna.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com//github/neptune-ai/neptune-examples/blob/master/integrations/optuna/docs/Neptune-Optuna.ipynb)

# Getting help
If you got stuck or simply want to talk to us about something here are your options:

* [documentation](https://docs.neptune.ai),
* [video tutorials](https://www.youtube.com/playlist?list=PLKePQLVx9tOd8TEGdG4PAKz0Owqdv1aaw),
* Chat! When in application click on the [blue message icon](https://docs.neptune.ai/getting-started/getting-help#chat) in the bottom-right corner and send a message. A real person will talk to you ASAP (typically very ASAP),
* You can just shoot us an email at [contact@neptune.ai](mailto:contact@neptune.ai).

# Neptune.ai is trusted by great companies
<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/Roche-logo.png" width="300" />
  <img src="https://neptune.ai/wp-content/uploads/NNAISENSE.png" width="300" />
  <img src="https://neptune.ai/wp-content/uploads/Senseye-1.png" width="300" />
</div>

<div align="center">
  <img src="https://neptune.ai/wp-content/uploads/Zesty.png" width="300" />
  <img src="https://neptune.ai/wp-content/uploads/NewYorker-2.png" width="300" />
  <img src="https://neptune.ai/wp-content/uploads/Intive-1.png" width="300" />
</div>

# People behind Neptune
Created with :heart: by the [Neptune.ai team](https://neptune.ai/about-us):

Piotr, Michał, Jakub, Paulina, Kamil, Małgorzata, Piotr, Aleksandra, Marcin, Hubert, Adam, Szymon, Jakub, Maciej, Piotr, Paweł, Patrycja, Grzegorz, Paweł, Natalia, Marcin and [you?](https://neptune.ai/jobs)

![neptune.ai](https://neptune.ai/wp-content/uploads/logo.png)
