ggt.utils

Submodules

Package Contents

Functions

discover_devices()

Check for available devices.

tensor_to_numpy(x)

Convert a torch tensor to NumPy for plotting.

arsinh_normalize(X)

Normalize a Torch tensor with arsinh.

load_tensor(filename, tensors_path[, as_numpy])

Load a Torch tensor from disk.

standardize_labels(input, data_dir, split, slug, ...)

Standardizes data. During training, input should

metric_output_transform_al_loss(output)

Transforms the output of the model, when using

metric_output_transform_al_cov_loss(output)

Transforms the output of the model, when using

load_cat(data_dir, slug, split)

Loads and returns pandas dataframe

get_output_shape(model, image_dim)

Get output shape of a PyTorch model or layer

enable_dropout(model)

Enable random dropout during inference. From StackOverflow #63397197

specify_dropout_rate(model, rate)

Specify the dropout rate of all layers

ggt.utils.discover_devices()

Check for available devices.

ggt.utils.tensor_to_numpy(x)

Convert a torch tensor to NumPy for plotting.

ggt.utils.arsinh_normalize(X)

Normalize a Torch tensor with arsinh.

ggt.utils.load_tensor(filename, tensors_path, as_numpy=True)

Load a Torch tensor from disk.

ggt.utils.standardize_labels(input, data_dir, split, slug, label_col, scaling, invert=False)

Standardizes data. During training, input should be the labels, and during inference, input should be the predictions.

ggt.utils.metric_output_transform_al_loss(output)

Transforms the output of the model, when using aleatoric loss, to a form which can be used by the ignote metric calculators

ggt.utils.metric_output_transform_al_cov_loss(output)

Transforms the output of the model, when using aleatoric covariance loss, to a form which can be used by the ignote metric calculators

ggt.utils.load_cat(data_dir, slug, split)

Loads and returns pandas dataframe

ggt.utils.get_output_shape(model, image_dim)

Get output shape of a PyTorch model or layer

ggt.utils.enable_dropout(model)

Enable random dropout during inference. From StackOverflow #63397197

ggt.utils.specify_dropout_rate(model, rate)

Specify the dropout rate of all layers