ShapeNetwork¶
-
class
ShapeNetwork(layer_cls, layer_kwargs, in_channels=1, norm_type='instance', img_size=224, feature_extractor=None, **kwargs)[source]¶ Bases:
shapenet.networks.abstract_network.AbstractShapeNetworkNetwork to Predict a single shape
-
static
closure(model, data_dict: dict, optimizers: dict, criterions={}, metrics={}, fold=0, **kwargs)[source]¶ closure method to do a single backpropagation step
Parameters: - model (
ShapeNetwork) – trainable model - data_dict (dict) – dictionary containing the data
- optimizers (dict) – dictionary of optimizers to optimize model’s parameters
- criterions (dict) – dict holding the criterions to calculate errors (gradients from different criterions will be accumulated)
- metrics (dict) – dict holding the metrics to calculate
- fold (int) – Current Fold in Crossvalidation (default: 0)
- **kwargs – additional keyword arguments
Returns: - dict – Metric values (with same keys as input dict metrics)
- dict – Loss values (with same keys as input dict criterions)
- list – Arbitrary number of predictions as
torch.Tensor
Raises: AssertionError– if optimizers or criterions are empty or the optimizers are not specified- model (
-
forward(input_images)[source]¶ Forward input batch through network and shape layer
Parameters: input_images ( torch.Tensor) – input batchReturns: predicted shapes Return type: torch.Tensor
-
model¶
-
static