ragulpr / wtte-rnn

WTTE-RNN a framework for churn and time to event prediction
MIT License
765 stars 187 forks source link

Add simple_example_python3_cpu to compatible with python 3.x #13

Closed aprotopopov closed 7 years ago

aprotopopov commented 7 years ago

Could be used as with CPU and GPU via constant variable USE_CPU. On my machine on CPU it's a bit faster.

aprotopopov commented 7 years ago

Replaced basestring to str for python3 due to errors.

ragulpr commented 7 years ago

Hey @aprotopopov awesome work!

I like the added lines to simple_example

USE_CPU = True

if USE_CPU:
    import os
    os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
    os.environ["CUDA_VISIBLE_DEVICES"] = ""

and it was useful for me as I'm experimenting with GPUs atm. Does it work across different architectures?

I do not feel like it deserves a separate notebook as those wore the only things I could see. Py3 compatibility is due to arrive in the notebooks soon.

Performancewise, did you try fixing the number of timesteps in the RNN? Rolling it out ought to improve performance.

aprotopopov commented 7 years ago

For CPU usage I just copy from the SO answer and I think it's could be used only with keras (if you mean different frameworks). Sure there should be one notebook for the simple example for both versions. Performance was OK for me, my GPU just didn't utilized with full power. That's why CPU won.

ragulpr commented 7 years ago

Thanks for noting it, I will definitely have compatibility in future notebooks!