# archai.networks.shakeshake package

## Submodules

## archai.networks.shakeshake.shake_resnet module

class `archai.networks.shakeshake.shake_resnet.``ShakeBlock`(in_ch, out_ch, stride=1)

  Bases: `torch.nn.modules.module.Module`

  `forward`(x)

    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.shakeshake.shake_resnet.``ShakeResNet`(depth, w_base, label)

  Bases: `torch.nn.modules.module.Module`

  `forward`(x)

    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.shakeshake.shake_resnext module

class `archai.networks.shakeshake.shake_resnext.``ShakeBottleNeck`(in_ch, mid_ch, out_ch, cardinary, stride=1)

  Bases: `torch.nn.modules.module.Module`

  `forward`(x)

    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.shakeshake.shake_resnext.``ShakeResNeXt`(depth, w_base, cardinary, label)

  Bases: `torch.nn.modules.module.Module`

  `forward`(x)

    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.shakeshake.shakeshake module

class `archai.networks.shakeshake.shakeshake.``ShakeShake`

  Bases: `torch.autograd.function.Function`

  static `backward`(ctx, grad_output)

    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, x1, x2, training=True)

    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.

class `archai.networks.shakeshake.shakeshake.``Shortcut`(in_ch, out_ch, stride)

  Bases: `torch.nn.modules.module.Module`

  `forward`(x)

    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.

## Module contents