Esempio n. 1
0
def define_subG(opt):
    opt_net = opt['network_subG']
    which_model = opt_net['which_model_G']
    subnet_type = which_model['subnet_type']
    if opt_net['init']:
        init = opt_net['init']
    else:
        init = 'xavier'

    down_num = int(math.log(opt_net['scale'], 2))

    netG = InvNet(opt_net['in_nc'], opt_net['out_nc'], subnet(subnet_type, init), opt_net['block_num'], down_num)

    return netG
Esempio n. 2
0
def define_G(opt):
    opt_net = opt['network_G']
    which_model = opt_net['which_model_G']
    subnet_type = which_model['subnet_type']
    opt_datasets = opt['datasets']

    if opt_net['init']:
        init = opt_net['init']
    else:
        init = 'xavier'

    down_num = int(math.log(opt_net['scale'], 2))

    netG = Net(opt, subnet(subnet_type, init), down_num)

    return netG
Esempio n. 3
0
def define_G(opt):
    opt_net: dict = opt["network_G"]
    which_model: dict = opt_net["which_model_G"]
    subnet_type: str = which_model["subnet_type"]

    # ??? 어차피 전부 xavier 같은데
    if opt_net["init"]:
        init = opt_net["init"]
    else:
        init = "xavier"

    down_num: int = int(math.log(opt_net["scale"], 2))

    netG = InvRescaleNet(
        opt_net["in_nc"],
        opt_net["out_nc"],
        subnet(subnet_type, init),
        opt_net["block_num"],
        down_num,
    )

    return netG