def initialize_network(self):
    if self.threeD:
        conv_op = nn.Conv3d
        dropout_op = nn.Dropout3d
        norm_op = nn.BatchNorm3d
    else:
        conv_op = nn.Conv2d
        dropout_op = nn.Dropout2d
        norm_op = nn.BatchNorm2d
    norm_op_kwargs = {'eps': 1e-05, 'affine': True}
    dropout_op_kwargs = {'p': 0, 'inplace': True}
    net_nonlin = nn.LeakyReLU
    net_nonlin_kwargs = {'negative_slope': 0.01, 'inplace': True}
    self.network = Generic_UNet(self.num_input_channels, self.base_num_features, self.num_classes, len(self.net_num_pool_op_kernel_sizes), self.conv_per_stage, 2, conv_op, norm_op, norm_op_kwargs, dropout_op, dropout_op_kwargs, net_nonlin, net_nonlin_kwargs, True, False, (lambda x: x), InitWeights_He(0.01), self.net_num_pool_op_kernel_sizes, self.net_conv_kernel_sizes, False, True, True)
    if torch.cuda.is_available():
        self.network.cuda()
    self.network.inference_apply_nonlin = softmax_helper
def initialize_network(self):
    if self.threeD:
        conv_op = nn.Conv3d
        dropout_op = nn.Dropout3d
        norm_op = nn.BatchNorm3d
    else:
        conv_op = nn.Conv2d
        dropout_op = nn.Dropout2d
        norm_op = nn.BatchNorm2d
    norm_op_kwargs = {'eps': 1e-05, 'affine': True}
    dropout_op_kwargs = {'p': 0, 'inplace': True}
    net_nonlin = nn.LeakyReLU
    net_nonlin_kwargs = {'negative_slope': 0.01, 'inplace': True}
    self.network = Generic_UNet(self.num_input_channels, self.base_num_features, self.num_classes, len(self.net_num_pool_op_kernel_sizes), self.conv_per_stage, 2, conv_op, norm_op, norm_op_kwargs, dropout_op, dropout_op_kwargs, net_nonlin, net_nonlin_kwargs, True, False, (lambda x: x), InitWeights_He(0.01), self.net_num_pool_op_kernel_sizes, self.net_conv_kernel_sizes, False, True, True)
    if torch.cuda.is_available():
        self.network.cuda()
    self.network.inference_apply_nonlin = softmax_helper