Closed gabrieltseng closed 5 years ago
Re: the experiment name, I think maybe we could think about that after your stuff is added?
But I agree that this is a pretty universal use case, so it might not be worth adding an extra folder just for this.
One additional note:
The deep explainer is currently failing with
File "/home/gabrieltseng95/miniconda3/envs/esowc-drought/lib/python3.7/site-packages/shap/explainers/deep/deep_pytorch.py", line 107, in <listcomp>
grads = [torch.autograd.grad(selected, x)[0].cpu().numpy() for x in X]
File "/home/gabrieltseng95/miniconda3/envs/esowc-drought/lib/python3.7/site-packages/torch/autograd/__init__.py", line 149, in grad
inputs, allow_unused)
RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.
I am not sure if this is a bug in this code, or in shap. I'll take a look, but merge this first to not block your stuff.
Turns out its a problem with shap; I'll try and fix it ASAP
Adds the one hot encoded prediction month to the models, so they know which month they are predicting.
In addition, extends the chunker to handle an arbitrary number of x tensors / arrays.