Readit News logoReadit News
Posted by u/willbakst 2 years ago
Show HN: Open-Sourcing Google's Lattice Models in PyTorchgithub.com/ControlAI/pyto...
We're a group of engineers, AI/ML enthusiasts, and author of this paper https://openreview.net/forum?id=0pxiMpCyBtr who saw a closed door in AI/ML and decided to open it. This project is a PyTorch reimagining of Google's TensorFlow Lattice models, which despite being labeled open-source, were previously open in name only (you have to be a Googler to contribute). Also, side point…TensorFlow is dying https://thenextweb.com/news/why-tensorflow-for-python-is-dyi...

Here's the deal: Lattice models excel in making AI interpretable—key for sectors where understanding model rationale is as crucial as the prediction. Yet, their potential was gated behind Google's walls.

Fueled by the spirit of true open-source philosophy and driven by the robust, community-centric ecosystem of PyTorch, we've built a toolkit that not only matches the functionality of Google's TensorFlow lattices but is open for everyone to contribute, improve, and innovate.

We're inviting you to join in. Whether it's to critique, contribute, or simply to learn, we believe your voice can help shape the future of open-source AI/ML.

https://github.com/ControlAI/pytorch-lattice

willbakst · 2 years ago
Hey all, I'm William Bakst, the creator of the library. I used to work at Google where I worked on the Glassbox research team (creators of TensorFlow Lattice and TensorFlow Constrained Optimization). It was crazy useful internally and approaches problems relevant to all kinds of businesses so I was kind of baffled that the 'open-source' version was only available to Google employs to contribute to. I think PyTorch has a better community around it anyways, so i've made an actual open-source version so any company that wants to take advantage of the explainability of a simple model like linear regression, but the accuracy of more complex models like deep neural networks, can start applying this now AND anyone can contribute, so hopefully this gets better and more accessible over time.
shaqbert · 2 years ago
Hi William, super nice tech. Alas, I am suffering from lack of imagination, can you give some example use cases where this tech would really shine?
willbakst · 2 years ago
Hi shaqbert! I'd love to give some examples.

When I was at Google, I helped develop models using this modeling technique that ended up in products such as Google Maps. These models are highly interpretable and, like xgboost, can be applied to classification and regressions tasks and more. I would say that there are a few cases in particular where these models really shine:

(1) You want more than just a prediction. You want to understand how your data impacts the prediction. For example, you might have a model for predicting sales of an item on your e-commerce platform, but you care deeply about how price impacts the prediction. These models have feature calibrators, which can really help you to understand how the model understand the feature. In the case of price, you might discover that the calibrator follows a concave shape, indicating that prices that are too low / too high are similar and that there is likely an optimal price somewhere in the middle. Perhaps you'll even discover close to that optimal price from the calibration analysis.

(2) You want to embed domain knowledge into the model. You want to make sure that model follows certain expected behaviors. This is where shape constraints shine. For example, when predicting creditworthiness, you'll want to make sure that more timely payments will only ever increase your creditworthiness (since otherwise the model wouldn't be fair). Another example here would be predicting the likelihood of a sale for an item on Amazon. It would make sense for the model to trust a feature for star rating more if the number of reviews is higher (since that's how a human would likely judge the rating themselves). A trust shape constraint here would make embedding this expected behavior into the model not just possible but easy.

Ultimately these models are what's considered "universal approximators" just like DNNs, able to approximate any function with sufficient data, so you can use them for any prediction task you're looking to solve (think of an alternative to xgboost you can try during modeling) that are more interpretable and controllable.