0.8
in a Float
field in params
namespace under name momentum
- params/momentum
will be its path. You can organize this way any type of metadata - images, parameters, metrics, scores, model checkpoint, CSV files, etc. Let look at the following code:NEPTUNE_PROJECT
and NEPTUNE_API_TOKEN
variables.neptune.log_artifact('model_viz.png')
run['model/viz'].upload('model_viz.png')
neptune.log_artifact('model.pt')
run['trained_model'].upload('model.pt')
neptune.download_artifact('model.pt')
run['trained_model'].download()
'model/last'
you upload a .pt
file, the file will be visible as 'last.pt'
in the UI.run['conf_matrix'].upload(plt_fig)
instead ofrun['conf_matrix'].upload(File.as_image(plt_fig))
.neptune-contrib
file-related functionalities into the core library (in fact there is no more neptune-contrib - see Integrations). The conversion methods are available as File
factory methods:from neptunecontrib.api import log_chart
log_chart('int_chart', chart)
from neptune.new.types import File
run['int_chart'].upload(File.as_html(chart))
from neptunecontrib.api import log_table
log_table('pred_df', df)
from neptune.new.types import File
run['pred_df'].upload(File.as_html(df))
from neptunecontrib.api import log_audio
log_audio('sample.mp3')
run['sample'].upload('sample.mp3')
from neptunecontrib.api import log_video
log_video('sample.mp4')
run['sample'].upload('sample.mp4')
from neptunecontrib.api import log_pickle
log_pickle('model.pkl', model)
from neptune.new.types import File
run['model'].upload(File.as_pickle(model))
from neptunecontrib.api import log_html
log_pickle('custom_viz', html_string)
from neptune.new.types import File
run['custom_viz'].upload(File.from_content(model), extension='html')
neptune.log_metric('acc', 0.97)
run['acc'].log(0.97)
neptune.log_metric('train_acc', 0.97)
run['train/acc'].log(0.97)
neptune.log_metric('loss', 0.8)
run['key'].log()
neptune.log_metric('final_accuracy', 0.8)
run['final_accuracy'] = 0.8
neptune.log_text('train_log', custom_log_msg)
run['train/log'].log(custom_log_msg)
neptune.log_image('misclasified', filepath)
run['misclasified'].log(File(filepath))
neptune.log_image('pred_dist', hist_chart)
run['pred_dist'].log(hist_chart)
File
field.neptune.log_image('train_hist', hist_chart)
run['train/hist'].upload(hist_chart)
neptune-contrib
library for the new Python API - each integration has now two parts:import neptune.new.integrations.framework_name
pip install neptune-framework-name
or as an extra together with neptune-client
pip install "neptune-client[framework-name]"
neptune-contrib
are still fully functional. You can use them both with projects using the previous structure and the new structure. However, integrations from neptune-contrib
are using legacy Python API while the new integrations are re-written to fully use possibilities provided by the new Python API and achieve better metadata organization.pip install neptune-contrib
pip install "neptune-client[tensorflow-keras]"
pip install neptune-tensorflow-keras
StringSet
field under sys/tags
path. neptune.create_experiment(params=params_dict)
run['parameters'] = params_dict
neptune.set_property('SEED', 2458)
run['properties/SEED'] = str(2458)
neptune.log_metric('acc', 0.98)
run['logs/acc'].log(0.98)
neptune.log_artifact('model.pt', 'model.pt')
run['artifacts/model'].upload('model.pt')
FloatSeries
and Float
are two different types and Neptune by default doesn't know how to compare them. Float
fields outside of create_experiment()
function and a common practice was to store those as FloatSeries
with one entry through the use of log_metric()
function. To achieve backward compatibility you need to create a FloatSeries with the neptune.new API as well, by using .log()
. String
fields. To achieve backward compatibility use the assign with an explicit casting to str
if you are not 100% sure that the resulting field will be a string.