anatools.anaclient.gan module

GAN Functions

create_gan_dataset(self, datasetId, modelId, name, description, tags, workspaceId=None)

Create a new GAN dataset based off an existing dataset. This will start a new job.

Parameters
  • modelId (str) – Model ID to use for the GAN.

  • datasetId (str) – Dataset ID to input into the GAN.

  • name (str) – Name for the GAN dataset.

  • description (str) – Description for the GAN dataset.

  • tags (list) – Tags for the GAN dataset.

  • workspaceId (str) – Workspace ID where the dataset exists.

Returns

The datsetId for the GAN Dataset job.

Return type

str

delete_gan_dataset(self, datasetId, workspaceId=None)

Deletes a GAN dataset job.

Parameters
  • datasetId (str) – Dataset ID for the GAN dataset.

  • workspaceId (str) – Workspace ID where the dataset exists.

Returns

Returns True if the GAN dataset was successfully deleted.

Return type

bool

delete_gan_model(self, modelId)

Delete the GAN model and remove access to it from all shared organizations. This can only be done by a user in the organization that owns the model.

Parameters

modelId (str) – The ID of a specific GAN model.

Returns

If True, the model was successfully deleted.

Return type

bool

download_gan_model(self, modelId, localDir=None)

Download the gan model file from your organization.

Parameters
  • modelId (str) – ModelId to download.

  • localDir (str) – Path for where to download the gan model. If none is provided, current working directory will be used.

Returns

The filepath of the downloaded GAN model.

Return type

str

edit_gan_model(self, modelId, name=None, description=None, flags=None, tags=None)

Edits the name, description, and flags of a gan model.

Parameters
  • modelId (str) – The modelId that will be updated.

  • name (str) – The new name of the gan model. Note: this name needs to be unique per organization.

  • description (str) – Description of the gan model

  • flags (str) – Flags for the model

  • tags (list[str]) – Tags for the model

Returns

If True, the model was successfully edited.

Return type

bool

get_gan_datasets(self, datasetId=None, gandatasetId=None, workspaceId=None, cursor=None, limit=None, fields=None)

Retrieve information about GAN-generated dataset jobs.

Parameters
  • datasetId (str) – Dataset ID to retrieve information for.

  • gandatasetId (str) – Gan dataset ID to retrieve.

  • workspaceId (str) – Workspace ID where the dataset exists.

  • cursor (str) – Cursor for pagination.

  • limit (int) – Maximum number of datasets to return.

  • fields (list) – List of fields to return, leave empty to get all fields.

Returns

Information about the GAN Datasets in the workspace.

Return type

list[dict]

get_gan_models(self, organizationId=None, workspaceId=None, modelId=None, cursor=None, limit=None, filters=None, fields=None)

Retrieve information about GAN models

Parameters
  • organizationId (str) – Organization ID that owns the models

  • workspaceId (str) – Workspace ID that contains the models

  • cursor (str) – Cursor for pagination.

  • limit (int) – Maximum number of models to return.

  • modelId (str) – Model ID to retrieve information for.

  • filters (dict) – Filters that limit output to entries that match the filter

  • fields (list) – List of fields to return, leave empty to get all fields.

Returns

GAN Model information.

Return type

list[dict]

upload_gan_model(self, name, description, modelfile, flags=None, tags=None, organizationId=None)

Uploades a GAN model to the microservice. The model will be owned by the specified organization. If organizationId is not given the model will be owned by that of the analcient.

Parameters
  • name (str) – A name for model.

  • description (str) – Details about the model.

  • modelfile (str) – The file of the model - relative to the local directry.

  • flags (str) – Parameters for use when running the model.

  • tags (list[str]) – Tags for the model.

  • organizationId (str) – Id of organization that owns the model, that of the anaclient if not given.

Returns

The modelId for the uploaded model.

Return type

str