def set_hyperparams(args):
    """
    Converts ArgumentParser args to hyperparam dictionary.

    :param args: Namespace containing the args.
    :return: A dictionary containing the args as hyperparams.
    """

    hyperparams = {'model_dim': args.model_dim,
                   'random_vec_dim': args.random_vec_dim,
                   'random_vec_std': args.random_vec_std,
                   'global_transformer': args.global_transformer,
                   'n_true_confs': args.n_true_confs,
                   'n_model_confs': args.n_model_confs,
                   'gnn1': {'depth': args.gnn1_depth,
                            'n_layers': args.gnn1_n_layers},
                   'gnn2': {'depth': args.gnn2_depth,
                            'n_layers': args.gnn2_n_layers},
                   'encoder': {'n_head': args.encoder_n_head},
                   'coord_pred': {'n_layers': args.coord_pred_n_layers},
                   'd_mlp': {'n_layers': args.d_mlp_n_layers},
                   'h_mol_mlp': {'n_layers': args.h_mol_mlp_n_layers},
                   'alpha_mlp': {'n_layers': args.alpha_mlp_n_layers},
                   'c_mlp': {'n_layers': args.c_mlp_n_layers},
                   'loss_type': args.loss_type,
                   'teacher_force': args.teacher_force,
                   'random_alpha': args.random_alpha}

    return hyperparams