Package: tonks
TonksNote 6/12/20: Our team previously had a tradition of naming projects with terms or characters from the Harry Potter series, but we are disappointed by J.K. Rowling’s persistent transphobic comments. In response, we will be renaming this repository, and are working to develop an inclusive solution that minimizes disruption to our users.Tonks is a general purpose deep learning library developed by the ShopRunner Data Science team to train multi-task image, text, or ensemble (image + text) models.What differentiates our library is that you can train a multi-task model with different datasets for each of your tasks. For example, you could train one model to label dress length for dresses and pants length for pants.See thedocsfor more details.To quickly get started, check out one of our tutorials in thenotebooksfolder. In particular, thesynthetic_datatutorial provides a very quick example of how the code works.Structurenotebooksfashion_data: a set of notebooks demonstrating training Tonks models on an open source fashion dataset consisting of images and text descriptionssynthetic_data: a set of notebooks demonstrating training Tonks models on a set of generated color swatches. This is meant to be an easy fast demo of the library's capabilities that can be run on CPU's.tonksensemble: code for ensemble models of text and vision modelstext: code for text models with a BERT architecturevision: code for vision models with ResNet50 architecturesInstallationpip install tonksYou may get an error from thetokenizerpackage if you do not have a Rust compiler installed; seehttps://github.com/huggingface/transformers/issues/2831#issuecomment-592724471.NotesCurrently, this library supports ResNet50 and BERT models.In some of our documentation the termspretrainedandvanillaappear.pretrainedis our shorthand for Tonks models that have been trained at least once already so their weights have been tuned for a specific use case.vanillais our shorthand for base weights coming fromtransformersorPyTorchfor the out-of-the-box BERT and ResNet50 models.For our examples using text models, we use thetransformersrepository managed by huggingface. The most recent version is calledtransformers. The huggingface repo is the appropriate place to check on BERT documentation and procedures.DevelopmentWant to add to or fix issues in Tonks? We welcome outside input and have tried to make it easier to test. You can run everything inside a docker container with the following:# to build the container# NOTE: this may take a whilenvidia-dockerbuild-ttonks.# nvidia-docker run : basic startup with nvidia docker to access gpu# --rm : deletes container when closed# -p : exposes ports (ex: for jupyter notebook to work)# bash : opens bash in the container once it starts# "pip install jupyter && bash" : install requirements-dev and bashnvidia-dockerrun\-it\--rm\-v"${PWD}:/tonks"\-p8888:8888\-p8000:8000\tonks/bin/bash-c"pip install jupyter && bash"# run jupyter notebookjupyternotebook--ip0.0.0.0--no-browser--allow-root--NotebookApp.token=''--NotebookApp.password=''LicenseCopyright (c) 2020, ShopRunnerRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.