linear_model.ZINB_grad.val_ZINB

linear_model.ZINB_grad.val_ZINB(val_data, model, device, epochs=15, X_val=None)[source]

Returns the validation loss and negative log-likelihood.

The function will perform the validation on a ZINB-Grad model. The following parameters would be the same during the validation process:

log_theta, beta_mu, `beta_pi, alpha_mu, and alpha_pi, and they will

not be updated.

However, the W, gamma_mu, and gamma_pi would change because their dimension depend on the number of samples, i.e., are sample specific.

Parameters

val_datatorch.Tensor

It is the validation data, a Tensor of shape (n_samples_val, n_features).

model: An object of the ZINB_Grad class

Please refer to the example.

deviceA torch.device object

Please refer to Pytorch documentation for more details.

epochsint (optional, default=15)

Number of iteration for training.

X_valtorch.Tensor (optional, default=None)

It is the X parameter of the ZINB-Grad model for the validation samples, a Tensor of shape (n_samples_val, M).

Returns

lossfloat

The validation loss

neg_log_likfloat

The validation negative log-likelihood