Giter VIP home page Giter VIP logo

bhm-at-scale's Introduction

Hi there, I'm Florian

I am a Data Scientist and Python developer with a strong mathematical background. Always looking to apply mathematics to real-world problems and enthusiastic about everything math.

As Head of Data Science at inovex GmbH, I enjoy working on innovative Data Science & Data Engineering projects with experts every day. In my spare time, I like to contribute to several OSS projects in the PyData stack and started the PyScaffold project to foster and establish best practices and clean coding within the Python ecosystem.

More about me on:

bhm-at-scale's People

Contributors

florianwilhelm avatar sn3fru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bhm-at-scale's Issues

Model training fails with current numpyro

Hi,

Thanks for the great blogpost + code. I've tried to run the model training with numpyro==0.7.2. Preprocessing runs, but model training fails with "NotImplementedError: This ELBO objective does not support mutable state.". The line that fails is in the training notebook train_handler.fit. The error seems to originate from numpyro introducing mutable states (I think from here line 57, loss_with_mutable_state method). Maybe this commit is related?

Any idea how to fix this error?

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-8-1349482c40ae> in <module>
----> 1 train_handler.fit(X_train, n_epochs=5_000, log_freq=1_000, lr=0.1)

~/opt/anaconda3/envs/bhm-at-scale/lib/python3.8/site-packages/bhm_at_scale-1.1.post0.dev3+gea40dd8.dirty-py3.8.egg/bhm_at_scale/handler.py in fit(self, X, n_epochs, log_freq, lr, **kwargs)
    130             self._fit(X, n_epochs)
    131         else:
--> 132             loss = self.svi.evaluate(self.svi_state, X) / X.shape[0]
    133 
    134             curr_epoch = 0

~/opt/anaconda3/envs/bhm-at-scale/lib/python3.8/site-packages/numpyro/infer/svi.py in evaluate(self, svi_state, *args, **kwargs)
    363         _, rng_key_eval = random.split(svi_state.rng_key)
    364         params = self.get_params(svi_state)
--> 365         return self.loss.loss(
    366             rng_key_eval,
    367             params,

~/opt/anaconda3/envs/bhm-at-scale/lib/python3.8/site-packages/numpyro/infer/elbo.py in loss(self, rng_key, param_map, model, guide, *args, **kwargs)
     44         :return: negative of the Evidence Lower Bound (ELBO) to be minimized.
     45         """
---> 46         return self.loss_with_mutable_state(
     47             rng_key, param_map, model, guide, *args, **kwargs
     48         )["loss"]

~/opt/anaconda3/envs/bhm-at-scale/lib/python3.8/site-packages/numpyro/infer/elbo.py in loss_with_mutable_state(self, rng_key, param_map, model, guide, *args, **kwargs)
     66         :return: a tuple of ELBO loss and the mutable state
     67         """
---> 68         raise NotImplementedError("This ELBO objective does not support mutable state.")
     69 
     70 

NotImplementedError: This ELBO objective does not support mutable state.

Kernel dies after inputting X array

Hi,
I am trying the multi dimensional array using my own data , we have around 7 features and one target column, it is a time series data however when we call the check_model and guide function the kernel dies. Can you suggest some troubleshooting

Could you mind to make a explanation for trainning GammaPoisson(alphas, betas) ?

Hello, first thank you to share the article , it is awesome !

I am trying to design a 4~5 level hierachical model now , and have a question about the parameter of GammaPoisson

From

return numpyro.sample(Site.days, dist.GammaPoisson(alphas, betas), obs=jnp.nan_to_num(targets))

means = (is_observed * jnp.exp(jnp.sum(jnp.expand_dims(coefs, axis=1) * features, axis=2))
         + not_observed*eps)

betas = is_observed*jnp.exp(-disp_params) + not_observed
alphas = means * betas
return numpyro.sample("days", dist.GammaPoisson(alphas, betas), obs=jnp.nan_to_num(targets))

I know such linear model called GLM (genelized linear model ) but I don't quite understand why you construct alphas and betas in this way .
Let me remove the is_observed and not_observed , aim to just focus alphas and betas :

betas  = exp(-disp_params)  = 1/exp(disp_params)
alphas  = exp( sum(coefs * feature) -disp_params  ) = exp(sum(coefs * feature)/exp(disp_params)

I just can't understand why they are contructed like this . I have viewed wiki and some sites to undertand negative binomial distribution and gamma-poisson distribution , but doesn't help to figure this out .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.