ICNN

class deepinv.models.ICNN(in_channels=3, num_filters=64, kernel_dim=5, num_layers=10, strong_convexity=0.5, pos_weights=True, device='cpu')[source]

Bases: Module

Convolutional Input Convex Neural Network (ICNN). The network is built to be convex in its input. The model is fully convolutional and thus can be applied to images of any size.

Based on the implementation from the paper “Data-Driven Mirror Descent with Input-Convex Neural Networks.

Parameters:
  • in_channels (int) – Number of input channels.

  • num_filters (int) – Number of hidden units.

  • kernel_dim – dimension of the convolutional kernels.

  • num_layers (int) – Number of layers.

  • strong_convexity (float) – Strongly convex parameter.

  • pos_weights (bool) – Whether to force positive weights in the forward pass.

  • device (str) – Device to use for the model.

forward(x)[source]

Define 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.