def initialize_network(threeD=True, num_classes=2):
    """
    This is specific to the U-Net and must be adapted for other network architectures
    :return:
    """
    # self.print_to_log_file(self.net_num_pool_op_kernel_sizes)
    # self.print_to_log_file(self.net_conv_kernel_sizes)

    if threeD:
        conv_op = nn.Conv3d
        dropout_op = nn.Dropout3d
        norm_op = nn.InstanceNorm3d
    else:
        conv_op = nn.Conv2d
        dropout_op = nn.Dropout2d
        norm_op = nn.InstanceNorm2d
    default_dict["num_classes"] = num_classes
    norm_op_kwargs = {'eps': 1e-5, 'affine': True}
    dropout_op_kwargs = {'p': 0, 'inplace': True}
    net_nonlin = nn.LeakyReLU
    net_nonlin_kwargs = {'negative_slope': 1e-2, 'inplace': True}
    network = Generic_UNet(default_dict["num_input_channels"], default_dict["base_num_features"], default_dict["num_classes"], len(default_dict["net_num_pool_op_kernel_sizes"]),
                           default_dict["conv_per_stage"], 2, conv_op, norm_op, norm_op_kwargs, dropout_op,
                           dropout_op_kwargs,
                           net_nonlin, net_nonlin_kwargs, False, False, lambda x: x, InitWeights_He(
        1e-2),
        default_dict["net_num_pool_op_kernel_sizes"], default_dict["net_conv_kernel_sizes"], False, True, True)
    print("nnUNet have {} paramerters in total".format(
        sum(x.numel() for x in network.parameters())))
    return network.cuda()

    This is specific to the U-Net and must be adapted for other network architectures
    :return:
    
code/networks/nnunet.py