estimat_var[not_const] = model.outputs.fitted_values
reg_std = np.sqrt(10 ** estimat_var)
batch_counts = X[batch_info == b].astype(np.float64).copy()
// clip large values as in Seurat
N = np.sum(batch_info == b)
vmax = np.sqrt(N)
After Change
ad = adata[batch_info == b]
X = ad.layers[layer] if layer is not None else ad.X
mean, var = _get_mean_var(X)
not_const = var > 0
estimat_var = np.zeros(adata.shape[1], dtype=np.float64)
y = np.log10(var[not_const])