Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAR model handling sample states with missing values #29

Open
sarahmish opened this issue Aug 26, 2021 · 0 comments
Open

PAR model handling sample states with missing values #29

sarahmish opened this issue Aug 26, 2021 · 0 comments

Comments

@sarahmish
Copy link

Environment details

If you are already running DeepEcho, please indicate the following details about the environment in
which you are running it:

  • DeepEcho version: 0.2.0
  • Python version: 3.7

Question

In PAR model _sample_state

dist = torch.distributions.Bernoulli(torch.sigmoid(x[0, 0, missing_idx]))
x[0, 0, missing_idx] = dist.sample()
x[0, 0, mu_idx] = x[0, 0, mu_idx] * (1.0 - x[0, 0, missing_idx])

Sampling from the Bernoulli distribution can yield a possibility of predicting the value as missing, which we then adjust mu to become zero to handle. This will have an effect on the returned data in _tensor_to_data
if (x[i, 0, missing_idx] > 0) and props['nulls']:
data[key].append(None)
else:
data[key].append(x[i, 0, mu_idx].item() * props['std'] + props['mu'])

This would potentially make us return props['mu'] value for each state we sampled as missing.

We should probably remove L472 and keep mu as is, then _tensor_to_data will handle the case as needed.

The same would be true to the "count" data type as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant