Why I Stopped Using Jupyter Notebooks

Given that I run multiple experiments in parallel, I have to tweak the preprocessing a little across all experiments..I need a way to automatically preprocess data given little instructions on my end.I use a technique called Few-Shot Learning where you train a model using very little data (like how we humans would)..Little money means less GPU memory to fit models and data in..To run experiments, we usually spin up a new notebook, write all the boilerplate, do the involved coding, and train the models..I need a way to write training scripts fast so I can run them on a terminal.The solution, as I thought, was to write my own framework.The framework should be dynamic enough to accommodate changes in models and experiments, and should be quick enough to prototype with so I can reduce the concept-to-testing delay..Notebooks would then be used only for exploring the data and for quick testing of models.Given the right cases, I should be able to train multiple variants of my models and preprocessing settings in a short span of time..I realized that much of our lab’s research could be made quicker by something like this.Towards an Automated Neural Networks FrameworkThree things, I told myself:A preprocessing pipeline that smartly knows how to process your data for you.An automated training engine that takes your model and data and efficiently trains it on a GPU, maximizing half-precision compute as much as possible.Utility functions that make heavy lifting of data quick work.If you took these three things, package them in a framework, and allow people to write experiments in a Python script at most 100 lines long, then it would shorten the concept-to-experiment delay.I ran the idea over with my mentor (who wrote his own mini framework that suited his needs, which in turn inspired the original mini-framework I wrote). I also ran it over with our former lab head who is currently on his PhD study leave. After some idea-sharing and expectation setting, I knew I needed to make a proof of concept.I decided to call that proof of concept “The Lightpost Project.”Complete with a crappy logotype to fool myself into thinking I’m using a legit framework ;)For anyone who would want to check out the alpha version of the framework, I’ll (shamelessly) plug the GitHub repo here:LightpostAutomated Neural Networks Training Framework..Yes, Keras might seem like the immediate answer to such a need, but unlike Keras (which by the way undoubtedly delivers the best UX for general purpose Deep Learning), Lightpost provides data pipelines which autoprocesses your data for you..It also sits on top of PyTorch and is 100% extensible using PyTorch code.At the end of the day, I’d like to be able to write my models in PyTorch, leverage Lightpost to feed in my data seamlessly, load my pretrained word embeddings easily, then feed it to a training engine that automatically maximizes my GPU for me in the background..There is still no data pipeline that automatically processes categorical data (sorry, Titanic Dataset!)One-shot/Few-shot support. This is the original use case I made my framework for. The reason why they’re not baked in yet is because I made code-breaking design choices when I decided to generalize to a larger use case than just one-shot/few-shot learning. It actually already exists, just not in the GitHub repo. Still ironing out some creases before I release it in alpha.If you decide to somehow test drive the alpha version of the framework, then you have my thanks. Beware of bugs in the code as it’s currently in 0.0.3a and it’s expected to break if you use it for things you’re not supposed to. But hey, it does give you a lot of utility out of the box already.Please consider filing a bug report if you see one. If you liked the project, please consider starring the repo 😉 And in the rare occasion that you’d like to contribute, please drop by the Issues Tracker in GitHub and I’d love to hear you out!Looking back, it’s interesting how a very frustrating night of running experiments led to the initiative to build a neural networks framework.From writing boilerplate, to making a sad mishmash mini-framework for thesis, to building a prototype of a fully-fledged framework that we can use for research someday, it was a great learning experience seeing my design choices change and my priorities grow..While notebooks are awesome for data exploration and for making demos of trained models, I stopped relying on them for training multiple things at once.I envision Lightpost to be some sort of an in-house tool that we can use in the University’s labs someday.. More details

Leave a Reply