def get_model_params(hparams):
    """Returns dict containing all params considered essential for defining a model in that class.

    Parameters
    ----------
    hparams : :obj:`dict`
        all relevant hparams for the given model class will be pulled from this dict

    Returns
    -------
    :obj:`dict`
        hparams dict

    """

    model_class = hparams['model_class']

    # start with general params
    hparams_less = {
        'rng_seed_data': hparams['rng_seed_data'],
        'trial_splits': hparams['trial_splits'],
        'train_frac': hparams['train_frac'],
        'rng_seed_model': hparams['rng_seed_model'],
        'model_class': hparams['model_class'],
        'model_type': hparams['model_type'],
    }

    if model_class == 'ae' or model_class == 'vae':
        hparams_less['n_ae_latents'] = hparams['n_ae_latents']
        hparams_less['fit_sess_io_layers'] = hparams['fit_sess_io_layers']
        hparams_less['learning_rate'] = hparams['learning_rate']
        hparams_less['l2_reg'] = hparams['l2_reg']
    elif model_class == 'arhmm' or model_class == 'hmm':
        hparams_less['n_arhmm_lags'] = hparams['n_arhmm_lags']
        hparams_less['noise_type'] = hparams['noise_type']
        hparams_less['kappa'] = hparams['kappa']
        hparams_less['ae_experiment_name'] = hparams['ae_experiment_name']
        hparams_less['ae_version'] = hparams['ae_version']
        hparams_less['ae_model_type'] = hparams['ae_model_type']
        hparams_less['n_ae_latents'] = hparams['n_ae_latents']
    elif model_class == 'arhmm-labels' or model_class == 'hmm-labels':
        hparams_less['n_arhmm_lags'] = hparams['n_arhmm_lags']
        hparams_less['noise_type'] = hparams['noise_type']
        hparams_less['kappa'] = hparams['kappa']
    elif model_class == 'neural-ae' or model_class == 'ae-neural':
        hparams_less['ae_experiment_name'] = hparams['ae_experiment_name']
        hparams_less['ae_version'] = hparams['ae_version']
        hparams_less['ae_model_type'] = hparams['ae_model_type']
        hparams_less['n_ae_latents'] = hparams['n_ae_latents']
    elif model_class == 'neural-arhmm' or model_class == 'arhmm-neural':
        hparams_less['arhmm_experiment_name'] = hparams['arhmm_experiment_name']
        hparams_less['arhmm_version'] = hparams['arhmm_version']
        hparams_less['n_arhmm_states'] = hparams['n_arhmm_states']
        hparams_less['n_arhmm_lags'] = hparams['n_arhmm_lags']
        hparams_less['noise_type'] = hparams['noise_type']
        hparams_less['kappa'] = hparams['kappa']
        hparams_less['ae_model_type'] = hparams['ae_model_type']
        hparams_less['n_ae_latents'] = hparams['n_ae_latents']
    elif model_class == 'bayesian-decoding':
        raise NotImplementedError
    else:
        raise NotImplementedError('"%s" is not a valid model class' % model_class)

    # decoder arch params
    if model_class == 'neural-ae' or model_class == 'ae-neural' \
            or model_class == 'neural-arhmm' or model_class == 'arhmm-neural':
        hparams_less['n_lags'] = hparams['n_lags']
        hparams_less['l2_reg'] = hparams['l2_reg']
        hparams_less['model_type'] = hparams['model_type']
        hparams_less['n_hid_layers'] = hparams['n_hid_layers']
        if hparams['n_hid_layers'] != 0:
            hparams_less['n_hid_units'] = hparams['n_hid_units']
        hparams_less['activation'] = hparams['activation']

    return hparams_less