archai.networks package

Submodules

archai.networks.pyramidnet module

class archai.networks.pyramidnet.BasicBlock(inplanes, planes, stride=1, downsample=None, p_shakedrop=1.0)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

outchannel_ratio = 1
class archai.networks.pyramidnet.Bottleneck(inplanes, planes, stride=1, downsample=None, p_shakedrop=1.0)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

outchannel_ratio = 4
class archai.networks.pyramidnet.PyramidNet(dataset, depth, alpha, n_classes, bottleneck=True)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

pyramidal_make_layer(block, block_depth, stride=1)[source]
archai.networks.pyramidnet.conv3x3(in_planes, out_planes, stride=1)[source]

3x3 convolution with padding

archai.networks.resnet module

class archai.networks.resnet.BasicBlock(inplanes, planes, stride=1, downsample=None)[source]

Bases: torch.nn.modules.module.Module

expansion = 1
forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class archai.networks.resnet.Bottleneck(inplanes, planes, stride=1, downsample=None)[source]

Bases: torch.nn.modules.module.Module

expansion = 4
forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class archai.networks.resnet.ResNet(dataset, depth, n_classes, bottleneck=False)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

archai.networks.resnet.conv3x3(in_planes, out_planes, stride=1)[source]

3x3 convolution with padding

archai.networks.shakedrop module

class archai.networks.shakedrop.ShakeDrop(p_drop=0.5, alpha_range=[- 1, 1])[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class archai.networks.shakedrop.ShakeDropFunction[source]

Bases: torch.autograd.function.Function

static backward(ctx, grad_output)[source]

Defines a formula for differentiating the operation.

This function is to be overridden by all subclasses.

It must accept a context ctx as the first argument, followed by as many outputs did forward() return, and it should return as many tensors, as there were inputs to forward(). Each argument is the gradient w.r.t the given output, and each returned value should be the gradient w.r.t. the corresponding input.

The context can be used to retrieve tensors saved during the forward pass. It also has an attribute ctx.needs_input_grad as a tuple of booleans representing whether each input needs gradient. E.g., backward() will have ctx.needs_input_grad[0] = True if the first input to forward() needs gradient computated w.r.t. the output.

static forward(ctx, x, training=True, p_drop=0.5, alpha_range=[- 1, 1])[source]

Performs the operation.

This function is to be overridden by all subclasses.

It must accept a context ctx as the first argument, followed by any number of arguments (tensors or other types).

The context can be used to store tensors that can be then retrieved during the backward pass.

archai.networks.wideresnet module

class archai.networks.wideresnet.WideBasic(in_planes, planes, dropout_rate, stride=1)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class archai.networks.wideresnet.WideResNet(depth, widen_factor, dropout_rate, n_classes)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

archai.networks.wideresnet.conv3x3(in_planes, out_planes, stride=1)[source]
archai.networks.wideresnet.conv_init(m)[source]

Module contents

archai.networks.get_model(conf, num_class=10)[source]
archai.networks.num_class(dataset)[source]