def update_args(args, best_params):
    """Update some of the parameters after optuna optimization.

    """

    if args.decode_type in args.rnn_decoders:
        # Regardless of fix_do, init_std is optimized so need to be updated
        args.init_std = float(best_params['init_std'])
        # If layers and hidden units are not fixed, it's optimized so update
        if args.fix_do == 0:
            args.rnn_num_hidden = int(best_params['rnn_num_hidden'])
            args.rnn_num_stack_layers = int(
                best_params['rnn_num_stack_layers'])
    # Do the same for TCN
    elif args.decode_type in args.cnn_decoders:
        args.tcn_num_hidden = int(best_params['tcn_num_hidden'])
        args.tcn_num_layers = int(best_params['tcn_num_layers'])
        args.tcn_kernel_size = int(best_params['tcn_kernel_size'])

    return args