def name_from_config()

in BigGAN_PyTorch/utils.py [0:0]


def name_from_config(config):
    name = "_".join(
        [
            item
            for item in [
                "Big%s" % config["which_train_fn"],
                config["dataset"],
                config["model"] if config["model"] != "BigGAN" else None,
                "seed%d" % config["seed"],
                "Gch%d" % config["G_ch"],
                "Dch%d" % config["D_ch"],
                "Gd%d" % config["G_depth"] if config["G_depth"] > 1 else None,
                "Dd%d" % config["D_depth"] if config["D_depth"] > 1 else None,
                "bs%d" % config["batch_size"],
                "Gfp16" if config["G_fp16"] else None,
                "Dfp16" if config["D_fp16"] else None,
                "nDs%d" % config["num_D_steps"] if config["num_D_steps"] > 1 else None,
                "nDa%d" % config["num_D_accumulations"]
                if config["num_D_accumulations"] > 1
                else None,
                "nGa%d" % config["num_G_accumulations"]
                if config["num_G_accumulations"] > 1
                else None,
                "Glr%2.1e" % config["G_lr"],
                "Dlr%2.1e" % config["D_lr"],
                "GB%3.3f" % config["G_B1"] if config["G_B1"] != 0.0 else None,
                "GBB%3.3f" % config["G_B2"] if config["G_B2"] != 0.999 else None,
                "DB%3.3f" % config["D_B1"] if config["D_B1"] != 0.0 else None,
                "DBB%3.3f" % config["D_B2"] if config["D_B2"] != 0.999 else None,
                "Gnl%s" % config["G_nl"],
                "Dnl%s" % config["D_nl"],
                "Ginit%s" % config["G_init"],
                "Dinit%s" % config["D_init"],
                "G%s" % config["G_param"] if config["G_param"] != "SN" else None,
                "D%s" % config["D_param"] if config["D_param"] != "SN" else None,
                "Gattn%s" % config["G_attn"] if config["G_attn"] != "0" else None,
                "Dattn%s" % config["D_attn"] if config["D_attn"] != "0" else None,
                "Gortho%2.1e" % config["G_ortho"] if config["G_ortho"] > 0.0 else None,
                "Dortho%2.1e" % config["D_ortho"] if config["D_ortho"] > 0.0 else None,
                config["norm_style"] if config["norm_style"] != "bn" else None,
                "cr" if config["cross_replica"] else None,
                "Gshared" if config["G_shared"] else None,
                "hier" if config["hier"] else None,
                "ema" if config["ema"] else None,
                config["name_suffix"] if config["name_suffix"] else None,
            ]
            if item is not None
        ]
    )