Skip to content

Commit

Permalink
fix: wrong order in variable delarations and linting errors;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Nov 18, 2023
1 parent f6d4e37 commit f80467d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pypots/clustering/crli/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# License: BSD-3-Clause

import os
from typing import Union, Optional, Tuple
from typing import Union, Optional

import numpy as np
import torch
Expand Down
19 changes: 10 additions & 9 deletions pypots/clustering/vader/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


import os
from typing import Tuple, Union, Optional
from typing import Union, Optional

import numpy as np
import torch
Expand Down Expand Up @@ -443,6 +443,15 @@ def predict(
inputs = self._assemble_input_for_testing(data)
results = self.model.forward(inputs, training=False)

mu_tilde = results["mu_tilde"].cpu().numpy()
mu_tilde_collector.append(mu_tilde)
mu = results["mu"].cpu().numpy()
mu_collector.append(mu)
var = results["var"].cpu().numpy()
var_collector.append(var)
phi = results["phi"].cpu().numpy()
phi_collector.append(phi)

def func_to_apply(
mu_t_: np.ndarray,
mu_: np.ndarray,
Expand All @@ -465,16 +474,8 @@ def func_to_apply(
clustering_results_collector.append(clustering_results)

if return_latent_vars:
mu_tilde = results["mu_tilde"].cpu().numpy()
mu_tilde_collector.append(mu_tilde)
stddev_tilde = results["stddev_tilde"].cpu().numpy()
stddev_tilde_collector.append(stddev_tilde)
mu = results["mu"].cpu().numpy()
mu_collector.append(mu)
var = results["var"].cpu().numpy()
var_collector.append(var)
phi = results["phi"].cpu().numpy()
phi_collector.append(phi)
z = results["z"].cpu().numpy()
z_collector.append(z)
imputation_latent = results["imputation_latent"].cpu().numpy()
Expand Down

0 comments on commit f80467d

Please sign in to comment.