BaseEstimator

Guide & worked example · Source

BaseEstimator(device=None)

Base class for all estimators in trex.

Parameters

Name Type Description Default
device torch.device, str, or None Device to use for computations. If None, automatically selects ‘cuda’ if available, otherwise ‘cpu’. None

Attributes

Name Description
device
params

Methods

Name Description
fit Fit the model to the data.
summary Print a summary of the model results.
to Move all model parameters to specified device.

fit

BaseEstimator.fit(*args, **kwargs)

Fit the model to the data.

summary

BaseEstimator.summary()

Print a summary of the model results.

to

BaseEstimator.to(device)

Move all model parameters to specified device.

Parameters

Name Type Description Default
device torch.device or str Target device (‘cuda’, ‘cpu’, etc.) required

Returns

Name Type Description
BaseEstimator Self for method chaining