finetuner.finetuner module#

class finetuner.finetuner.Finetuner[source]#

Bases: object

Finetuner class.

login(force=False, interactive=None)[source]#

Login to Hubble account, initialize a client object and create a default experiment.

Parameters
  • force (bool) – If set to true, overwrite token and re-login.

  • interactive (Optional[bool]) – If set to true, will use notebook_login as interactive mode.

Note: Calling login is necessary for using finetuner.

create_experiment(name=None)#

Create an experiment.

Parameters

name (Optional[str]) – Optional name of the experiment. If None, the experiment is named after the current directory.

Return type

Experiment

Returns

An Experiment object.

get_experiment(name)#

Get an experiment by its name.

Parameters

name (str) – Name of the experiment.

Return type

Experiment

Returns

An Experiment object.

list_experiments()#

List every experiment.

Return type

List[Experiment]

delete_experiment(name)#

Delete an experiment by its name. :type name: str :param name: Name of the experiment. :rtype: Experiment :return: Deleted experiment.

delete_experiments()#

Delete every experiment. :rtype: List[Experiment] :return: List of deleted experiments.

create_run(model, train_data, eval_data=None, run_name=None, description=None, experiment_name=None, model_options=None, loss='TripletMarginLoss', miner=None, miner_options=None, optimizer='Adam', optimizer_options=None, learning_rate=None, epochs=5, batch_size=64, callbacks=None, scheduler_step='batch', freeze=False, output_dim=None, cpu=True, device='cuda', num_workers=4, to_onnx=False, csv_options=None, public=False, num_items_per_class=4)#

Create a run.

If an experiment name is not specified, the run will be created in the default experiment.

Return type

Run

Returns

A Run object.

get_run(run_name, experiment_name=None)#

Get run by its name and (optional) experiment.

If an experiment name is not specified, we’ll look for the run in the default experiment.

Parameters
  • run_name (str) – Name of the run.

  • experiment_name (Optional[str]) – Optional name of the experiment.

Return type

Run

Returns

A Run object.

list_runs(experiment_name=None)#

List every run.

If an experiment name is not specified, we’ll list every run across all experiments.

Parameters

experiment_name (Optional[str]) – Optional name of the experiment.

Return type

List[Run]

Returns

A list of Run objects.

delete_run(run_name, experiment_name=None)#

Delete a run.

If an experiment name is not specified, we’ll look for the run in the default experiment.

Parameters
  • run_name (str) – Name of the run.

  • experiment_name (Optional[str]) – Optional name of the experiment.

delete_runs(experiment_name=None)#

Delete every run.

If an experiment name is not specified, we’ll delete every run across all experiments.

Parameters

experiment_name (Optional[str]) – Optional name of the experiment.

get_token()#
Return type

str