openvax / mhcflurry

Peptide-MHC I binding affinity prediction
http://openvax.github.io/mhcflurry/
Apache License 2.0
193 stars 58 forks source link

Prediction Speed Caching Improvements #96

Closed rohanpai closed 7 years ago

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.1%) to 75.45% when pulling 0eae504b1cec936c8f94e032be180e3f31ebf249 on rohan/prediction_speed into 009905ddc48543b6567c7bb7d559141a4a2f5a4d on master.

timodonnell commented 7 years ago

Thanks for identifying this optimization @rohanpai . I think your implementation makes sense. I'm slightly biased toward handling this in the Class1NeuralNetwork though as it's really an optimization that intimately depends on how Keras works, and that's the class that interfaces with Keras. It also seems slightly odd to load all the Class1NeuralNetwork instances in Class1AffinityPredictor but then only use one to actually make the predictions.

On the other hand, my implementation uses a global cache and is more complicated.

Curious if my PR #97 makes sense to you and if you spot any issues there

timodonnell commented 7 years ago

Closing in favor of #97 , thanks for spotting this possible optimization @rohanpai