(args: argparse.Namespace)
method to train the progan (progressively grown gan) given the configuration parameters
    Args:
        args: configuration used for the training
    Returns: None
method to train the progan (progressively grown gan) given the configuration parameters
    Args:
        args: configuration used for the training
    Returns: None
method to train the progan ( progressively grown gan ) given the configuration parameters Args : args : configuration used for the training Returns : None
def train_progan(args: argparse.Namespace) -> None:
    """
    method to train the progan (progressively grown gan) given the configuration parameters
    Args:
        args: configuration used for the training
    Returns: None
    """
    print(f"Selected arguments: {args}")

    generator = Generator(
        depth=args.depth,
        num_channels=args.num_channels,
        latent_size=args.latent_size,
        use_eql=args.use_eql,
    )
    discriminator = Discriminator(
        depth=args.depth,
        num_channels=args.num_channels,
        latent_size=args.latent_size,
        use_eql=args.use_eql,
    )

    progan = ProGAN(
        generator,
        discriminator,
        device=device,
        use_ema=args.use_ema,
        ema_beta=args.ema_beta,
    )

    progan.train(
        dataset=ImageDirectoryDataset(
            args.train_path,
            transform=get_transform(
                new_size=(int(2 ** args.depth), int(2 ** args.depth)),
                flip_horizontal=args.flip_horizontal,
            ),
            rec_dir=args.rec_dir,
        ),
        epochs=args.epochs,
        batch_sizes=args.batch_sizes,
        fade_in_percentages=args.fade_in_percentages,
        loss_fn=args.loss_fn,
        batch_repeats=args.batch_repeats,
        gen_learning_rate=args.g_lrate,
        dis_learning_rate=args.d_lrate,
        num_samples=args.num_feedback_samples,
        start_depth=args.start_depth,
        num_workers=args.num_workers,
        feedback_factor=args.feedback_factor,
        checkpoint_factor=args.checkpoint_factor,
        save_dir=args.output_dir,
    )
def train_progan ( args : argparse . Namespace ) -> None : print ( f"Selected arguments: {args}" ) generator = Generator ( depth = args . depth , num_channels = args . num_channels , latent_size = args . latent_size , use_eql = args . use_eql , ) discriminator = Discriminator ( depth = args . depth , num_channels = args . num_channels , latent_size = args . latent_size , use_eql = args . use_eql , ) progan = ProGAN ( generator , discriminator , device = device , use_ema = args . use_ema , ema_beta = args . ema_beta , ) progan . train ( dataset = ImageDirectoryDataset ( args . train_path , transform = get_transform ( new_size = ( int ( 2 ** args . depth ) , int ( 2 ** args . depth ) ) , flip_horizontal = args . flip_horizontal , ) , rec_dir = args . rec_dir , ) , epochs = args . epochs , batch_sizes = args . batch_sizes , fade_in_percentages = args . fade_in_percentages , loss_fn = args . loss_fn , batch_repeats = args . batch_repeats , gen_learning_rate = args . g_lrate , dis_learning_rate = args . d_lrate , num_samples = args . num_feedback_samples , start_depth = args . start_depth , num_workers = args . num_workers , feedback_factor = args . feedback_factor , checkpoint_factor = args . checkpoint_factor , save_dir = args . output_dir , )