scripts/model_utils.py
def RG_pred_ll(model, r_mode, cov_used, cv_set, neuron_group=None, ll_mode='GH', ll_samples=100, cov_samples=1, 
               beta=1.0, bound='ELBO'):
    """
    Compute the predictive log likelihood (ELBO).
    """
    ftrain, fcov, vtrain, vcov = cv_set
    time_steps = vtrain.shape[-1]
    
    vcov = cov_used(r_mode, vcov)
    model.inputs.set_XZ(vcov, time_steps, batch_size=time_steps)
    model.likelihood.set_Y(vtrain, batch_size=time_steps)
    model.validate_model(likelihood_set=True)
    
    return -model.objective(0, cov_samples=cov_samples, ll_mode=ll_mode, bound=bound, neuron=neuron_group, 
                            beta=beta, ll_samples=ll_samples).data.cpu().numpy()

    Compute the predictive log likelihood (ELBO).
    
Compute the predictive log likelihood (ELBO).
Compute the predictive log likelihood ( ELBO ) .
def RG_pred_ll(model, r_mode, cov_used, cv_set, neuron_group=None, ll_mode='GH', ll_samples=100, cov_samples=1, 
               beta=1.0, bound='ELBO'):
    ftrain, fcov, vtrain, vcov = cv_set
    time_steps = vtrain.shape[-1]
    vcov = cov_used(r_mode, vcov)
    model.inputs.set_XZ(vcov, time_steps, batch_size=time_steps)
    model.likelihood.set_Y(vtrain, batch_size=time_steps)
    model.validate_model(likelihood_set=True)
    return -model.objective(0, cov_samples=cov_samples, ll_mode=ll_mode, bound=bound, neuron=neuron_group, 
                            beta=beta, ll_samples=ll_samples).data.cpu().numpy()
def RG_pred_ll ( model , r_mode , cov_used , cv_set , neuron_group = None , ll_mode = 'GH' , ll_samples = 100 , cov_samples = 1 , beta = 1.0 , bound = 'ELBO' ) : ftrain , fcov , vtrain , vcov = cv_set time_steps = vtrain . shape [ - 1 ] vcov = cov_used ( r_mode , vcov ) model . inputs . set_XZ ( vcov , time_steps , batch_size = time_steps ) model . likelihood . set_Y ( vtrain , batch_size = time_steps ) model . validate_model ( likelihood_set = True ) return - model . objective ( 0 , cov_samples = cov_samples , ll_mode = ll_mode , bound = bound , neuron = neuron_group , beta = beta , ll_samples = ll_samples ) . data . cpu ( ) . numpy ( )
Compute the predictive log likelihood (ELBO).
Compute the predictive log likelihood ( ELBO ) .
"""
    Compute the predictive log likelihood (ELBO).
    """
model
r_mode
cov_used
cv_set
neuron_group
ll_mode
ll_samples
cov_samples
beta
bound