core.models.escaip.utils.stochastic_depth#

Modified from pytorch/vision

Classes#

StochasticDepth

Stochastic Depth for graph features.

SkipStochasticDepth

Skip Stochastic Depth for graph features.

Functions#

stochastic_depth_2d(→ torch.Tensor)

Implements the Stochastic Depth from `"Deep Networks with Stochastic Depth"

stochastic_depth_3d(→ torch.Tensor)

Module Contents#

core.models.escaip.utils.stochastic_depth.stochastic_depth_2d(input: torch.Tensor, batch: torch.Tensor, p: float, training: bool = True) torch.Tensor#

Implements the Stochastic Depth from “Deep Networks with Stochastic Depth” used for randomly dropping residual branches of residual architectures.

Parameters:
  • input (Tensor[num_nodes, ...]) – The input tensor or arbitrary dimensions with the first one being its node dimension.

  • batch (LongTensor[num_nodes]) – The batch tensor of the input tensor.

  • p (float) – probability of the input to be zeroed.

  • training – apply stochastic depth if is True. Default: True

Returns:

The randomly zeroed tensor.

Return type:

Tensor[N, …]

core.models.escaip.utils.stochastic_depth.stochastic_depth_3d(input: torch.Tensor, batch: torch.Tensor, p: float, training: bool = True) torch.Tensor#
class core.models.escaip.utils.stochastic_depth.StochasticDepth(p: float)#

Bases: torch.nn.Module

Stochastic Depth for graph features.

p#
forward(node_features, edge_features, node_batch)#
__repr__() str#
class core.models.escaip.utils.stochastic_depth.SkipStochasticDepth(*args, **kwargs)#

Bases: torch.nn.Module

Skip Stochastic Depth for graph features.

forward(node_features, edge_features, _)#
__repr__() str#