hyrax.models.hsc_dcae#

Classes#

ArcsinhActivation

Helper module for HSCDAE to use the arcsinh function

HSCDCAE

This autoencoder is designed to work with datasets that are prepared with Hyrax's HSC Data Set class.

Module Contents#

class ArcsinhActivation(*args: Any, **kwargs: Any)[source]#

Bases: torch.nn.Module

Helper module for HSCDAE to use the arcsinh function

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]#
class HSCDCAE(config, data_sample=None)[source]#

Bases: torch.nn.Module

This autoencoder is designed to work with datasets that are prepared with Hyrax’s HSC Data Set class.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

encoder1[source]#
encoder2[source]#
encoder3[source]#
encoder4[source]#
pool[source]#
decoder4[source]#
decoder3[source]#
decoder2[source]#
decoder1[source]#
activation[source]#
config[source]#
forward(x)[source]#
train_batch(batch)[source]#

This function contains the logic for a single training step. i.e. the contents of the inner loop of a ML training process.

Parameters:

batch (tuple) – A tuple containing the input data for the current batch, possibly with labels that are ignored.

Returns:

Current loss value – Dictionary containing the loss value for the current batch.

Return type:

dict

validate_batch(batch)[source]#

This function contains the logic for a single validation step that will process a single batch of data. i.e. the contents of the inner loop of a ML validation process.

Parameters:

batch (tuple) – A tuple containing the input data for the current batch, possibly with labels that are ignored.

Returns:

Current loss value – Dictionary containing the loss value for the current batch.

Return type:

dict

test_batch(batch)[source]#

This function contains the logic for a single testing step that will process a single batch of data. i.e. the contents of the inner loop of a ML testing process. In this case, it is identical to validate_batch.

Parameters:

batch (tuple) – A tuple containing the input data for the current batch, possibly with labels that are ignored.

Returns:

Current loss value – Dictionary containing the loss value for the current batch.

Return type:

dict

infer_batch(batch)[source]#

This function contains the logic for a single inference step that will process a single batch of data. i.e. the contents of the inner loop of a ML inference process.

Parameters:

batch (tuple) – A tuple containing the input data for the current batch, possibly with labels that are ignored.

Returns:

Reconstructed outputs – The reconstructed outputs from the autoencoder.

Return type:

torch.Tensor