Skip to content

Commit

Permalink
Neptune 3.0 (#27) (#28)
Browse files Browse the repository at this point in the history
* adjusted to neptune-client
* dropped tests
  • Loading branch information
jakubczakon authored Apr 15, 2019
1 parent 1b1d040 commit 3330102
Show file tree
Hide file tree
Showing 39 changed files with 471 additions and 1,837 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# neptune-contrib
[![Build Status](https://travis-ci.org/neptune-ml/neptune-contrib.svg?branch=master)](https://travis-ci.org/neptune-ml/neptune-contrib)

# Note
This lib is compatible with `neptune-cli` and some part may not work with `neptune-client`.
It will be updated for `neptune-client` soon (ETA `4.7.2019`).

# Documentation
See [neptune-contrib documentation site](https://neptune-contrib.readthedocs.io)

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
author = 'Neptune Dev Team'

# The short X.Y version
version = '0.2'
version = '0.4'
# The full version, including alpha/beta/rc tags
release = '0.2.0'
release = '0.4.0'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions docs/examples/examples_index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
.. toctree::
Interactive experiment run comparison <interactive_compare_experiments>
Hyper parameter comparison <explore_hyperparams_skopt>
Run skopt/hyperopt hyperparameter sweep <run_hyperparameter_search>
Log model diagnostics <log_model_diagnostics>
Monitor lightGBM training <monitor_lgbm>
Monitor fast.ai training <monitor_fastai>
Log matplotlib charts to neptune <log_matplotlib>
Work with local notebooks <local_notebooks>
Visualize project progress <project_progress>
Sync experiments with Neptune via json file <sync_with_json>
Telegram bot <telegram_bot>
2 changes: 1 addition & 1 deletion docs/examples/interactive_compare_experiments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "neptunecontrib_py36",
"display_name": "scraping",
"language": "python",
"name": "python3"
},
Expand Down
206 changes: 0 additions & 206 deletions docs/examples/local_notebooks.ipynb

This file was deleted.

Binary file not shown.
127 changes: 0 additions & 127 deletions docs/examples/log_matplotlib.ipynb

This file was deleted.

41 changes: 38 additions & 3 deletions docs/examples/log_model_diagnostics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"source": [
"import neptune\n",
"\n",
"ctx = neptune.Context()"
"neptune.init(project_qualified_name='USER_NAME/PROJECT_NAME')\n",
"neptune.create_experiment()"
]
},
{
Expand All @@ -63,7 +64,7 @@
"source": [
"from neptunecontrib.monitoring.reporting import send_binary_classification_report\n",
"\n",
"send_binary_classification_report(ctx, y_test, y_test_pred, threshold=0.5)"
"send_binary_classification_report(y_test, y_test_pred, threshold=0.5)"
]
},
{
Expand All @@ -85,7 +86,7 @@
"source": [
"from neptunecontrib.monitoring.reporting import send_confusion_matrix\n",
"\n",
"send_confusion_matrix(ctx, y_test, y_test_pred[:, 1] > 0.5)"
"send_confusion_matrix(y_test, y_test_pred[:, 1] > 0.5)"
]
},
{
Expand Down Expand Up @@ -154,6 +155,40 @@
"send_prediction_distribution(y_test, y_test_pred[:, 1])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Stop Neptune experiment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"neptune.stop()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also put everything in the `with` block.\n",
"For example:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with neptune.create_experiment():\n",
" send_prediction_distribution(y_test, y_test_pred[:, 1])"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
26 changes: 15 additions & 11 deletions docs/examples/monitor_fastai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
"source": [
"import neptune\n",
"from neptunecontrib.monitoring.fastai import NeptuneMonitor\n",
"ctx = neptune.Context()\n",
"monitor = NeptuneMonitor(ctx=ctx)"
"\n",
"neptune.init(project_qualified_name='USER_NAME/PROJECT_NAME')\n",
"\n",
"with neptune.create_experiment():\n",
" monitor = NeptuneMonitor()"
]
},
{
Expand All @@ -59,10 +62,10 @@
"metadata": {},
"outputs": [],
"source": [
"learn = create_cnn(data, models.resnet18, \n",
" metrics=accuracy, \n",
" callbacks=[neptune_monitor])\n",
"learn.fit_one_cycle(20, 1e-2)"
" learn = create_cnn(data, models.resnet18, \n",
" metrics=accuracy, \n",
" callbacks=[neptune_monitor])\n",
" learn.fit_one_cycle(20, 1e-2)"
]
},
{
Expand Down Expand Up @@ -94,7 +97,7 @@
"import neptune\n",
"from neptunecontrib.monitoring.fastai import NeptuneMonitor\n",
"\n",
"ctx = neptune.Context()\n",
"neptune.init(project_qualified_name='USER_NAME/PROJECT_NAME')\n",
"\n",
"mnist = untar_data(URLs.MNIST_TINY)\n",
"tfms = get_transforms(do_flip=False)\n",
Expand All @@ -106,15 +109,16 @@
" .databunch()\n",
" .normalize(imagenet_stats))\n",
"\n",
"neptune_monitor = NeptuneMonitor(ctx=ctx)\n",
"learn = create_cnn(data, models.resnet18, metrics=accuracy, callbacks=[neptune_monitor])\n",
"learn.fit_one_cycle(20, 1e-2)"
"with neptune.create_experiment():\n",
" neptune_monitor = NeptuneMonitor()\n",
" learn = create_cnn(data, models.resnet18, metrics=accuracy, callbacks=[neptune_monitor])\n",
" learn.fit_one_cycle(20, 1e-2)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "neptunecontrib py36",
"display_name": "scraping",
"language": "python",
"name": "python3"
},
Expand Down
60 changes: 50 additions & 10 deletions docs/examples/monitor_lgbm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
"import neptune\n",
"from neptunecontrib.monitoring.lightgbm import neptune_monitor\n",
"\n",
"ctx = neptune.Context()\n",
"neptune.init(project_qualified_name='USER_NAME/PROJECT_NAME')\n",
"\n",
"neptune.create_experiment()\n",
"\n",
"monitor = neptune_monitor()"
]
},
Expand All @@ -75,6 +78,39 @@
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Stop Neptune experiment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"neptune.stop()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also put everything in the `with` block:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with neptune.create_experiment():\n",
" ..."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -101,8 +137,11 @@
"import lightgbm as lgb\n",
"from sklearn.model_selection import train_test_split\n",
"from sklearn.datasets import load_wine\n",
"import neptune\n",
"from neptunecontrib.monitoring.lightgbm import neptune_monitor\n",
"\n",
"neptune.init(project_qualified_name='USER_NAME/PROJECT_NAME')\n",
"\n",
"data = load_wine()\n",
"X_train, X_test, y_train, y_test = train_test_split(data.data, data.target, test_size=0.1)\n",
"lgb_train = lgb.Dataset(X_train, y_train)\n",
Expand All @@ -116,21 +155,22 @@
" 'feature_fraction': 0.9\n",
" }\n",
"\n",
"monitor = neptune_monitor()\n",
"with neptune.create_experiment():\n",
" monitor = neptune_monitor()\n",
"\n",
"gbm = lgb.train(params,\n",
" lgb_train,\n",
" num_boost_round=500,\n",
" valid_sets=[lgb_train, lgb_eval],\n",
" valid_names=['train','valid'],\n",
" callbacks=[monitor],\n",
" )"
" gbm = lgb.train(params,\n",
" lgb_train,\n",
" num_boost_round=500,\n",
" valid_sets=[lgb_train, lgb_eval],\n",
" valid_names=['train','valid'],\n",
" callbacks=[monitor],\n",
" )"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "scraping",
"language": "python",
"name": "python3"
},
Expand Down
Loading

0 comments on commit 3330102

Please sign in to comment.