This is an unofficial PyTorch implementation by Ignacio Oguiza - timeseriesAI@gmail.com modified from:

class FCNPlus[source]

FCNPlus(c_in, c_out, layers=[128, 256, 128], kss=[7, 5, 3], coord=False, separable=False, zero_norm=False, act=ReLU, act_kwargs={}, residual=False) :: Sequential

A sequential container. Modules will be added to it in the order they are passed in the constructor. Alternatively, an ordered dict of modules can also be passed in.

To make it easier to understand, here is a small example::

# Example of using Sequential
model = nn.Sequential(
          nn.Conv2d(1,20,5),
          nn.ReLU(),
          nn.Conv2d(20,64,5),
          nn.ReLU()
        )

# Example of using Sequential with OrderedDict
model = nn.Sequential(OrderedDict([
          ('conv1', nn.Conv2d(1,20,5)),
          ('relu1', nn.ReLU()),
          ('conv2', nn.Conv2d(20,64,5)),
          ('relu2', nn.ReLU())
        ]))
xb = torch.rand(16, 3, 10)
test_eq(FCNPlus(3, 2)(xb).shape, [xb.shape[0], 2])
test_eq(FCNPlus(3, 2, coord=True, separable=True, act=Swish, residual=True)(xb).shape, [xb.shape[0], 2])
test_eq(nn.Sequential(*FCNPlus(3, 2).children())(xb).shape, [xb.shape[0], 2])
from tsai.models.utils import *
model = build_ts_model(FCNPlus, 2, 3)
model[-1]
Sequential(
  (0): AdaptiveAvgPool1d(output_size=1)
  (1): Squeeze(dim=-1)
  (2): Linear(in_features=128, out_features=3, bias=True)
)
from tsai.models.FCN import *
test_eq(total_params(FCN(3,2)), total_params(FCNPlus(3,2)))
FCNPlus(3,2)
FCNPlus(
  (backbone): _FCNBlockPlus(
    (convblock1): ConvBlock(
      (0): Conv1d(3, 128, kernel_size=(7,), stride=(1,), padding=(3,), bias=False)
      (1): BatchNorm1d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
    )
    (convblock2): ConvBlock(
      (0): Conv1d(128, 256, kernel_size=(5,), stride=(1,), padding=(2,), bias=False)
      (1): BatchNorm1d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
    )
    (convblock3): ConvBlock(
      (0): Conv1d(256, 128, kernel_size=(3,), stride=(1,), padding=(1,), bias=False)
      (1): BatchNorm1d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
    )
    (add): Sequential()
  )
  (head): Sequential(
    (0): AdaptiveAvgPool1d(output_size=1)
    (1): Squeeze(dim=-1)
    (2): Linear(in_features=128, out_features=2, bias=True)
  )
)