{"id":18647247,"url":"https://github.com/ttitcombe/tfshell2","last_synced_at":"2026-06-15T20:31:28.457Z","repository":{"id":115040794,"uuid":"181679198","full_name":"TTitcombe/tfShell2","owner":"TTitcombe","description":"A wrapper to take the hassle out of training and deploying Tensorflow 2.0 models","archived":false,"fork":false,"pushed_at":"2019-04-29T14:39:03.000Z","size":29,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-03T20:54:18.807Z","etag":null,"topics":["machine-learning","machine-learning-training","tensorflow","tensorflow-2","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TTitcombe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-16T11:49:51.000Z","updated_at":"2019-04-29T14:39:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea89a028-56e6-4f81-895c-1313d9965700","html_url":"https://github.com/TTitcombe/tfShell2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TTitcombe/tfShell2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2FtfShell2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2FtfShell2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2FtfShell2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2FtfShell2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TTitcombe","download_url":"https://codeload.github.com/TTitcombe/tfShell2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2FtfShell2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34379915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","machine-learning-training","tensorflow","tensorflow-2","unit-testing"],"created_at":"2024-11-07T06:25:21.470Z","updated_at":"2026-06-15T20:31:28.439Z","avatar_url":"https://github.com/TTitcombe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/TTitcombe/tfShell2.svg?branch=master)](https://travis-ci.com/TTitcombe/tfShell2)\n\n# tfShell2\n\n*Note: tfShell2 is under development*\n\n**tfShell2** contains helper classes and functions to take the pain out of training, testing, and saving your Tensorflow 2.0 models.\n\nTraining loops and exit conditions, logging, model saving and testing will be controlled **tfShell2** classes. \nAll you have to do is supply the model.\n\n## Motivation\ntfShell2 aims to:\n1. Improve the ease with which a variety of models are trained in Tensorflow 2\n2. Improve the ease with which model testing is carried out\n\nWith Tensorflow's Keras api, models can easily be trained using the `fit` method. However, this easy call is not easily compatible\nwith models which require more complex or dynamic training. For example, when training Generative Adversarial Networks, which are infamously\nunwilling to converge, you may wish to stop training early if the losses of the two networks follow a certain pattern. If \ntraining for a long time, you may wish to save the model when certain training milestones are passed, rather than \nbased on training time. tfShell2's **trainer** classes aim to make more expressive training possible minimal setup required.\n\nRegarding the second point: unit testing is criminally under-applied in machine learning. This is in part due to the hacky, proof-of-concept\nnature of much of ML development, partly because the stochasticity of models does not make them easy to test. \n\nHowever, there are certain tests which can be invaluable to a developer: Does my model train? (Do the weights change); Can it converge on simple data?;\nDo I get non-zero output from zero input? \ntfShell2 aims to facilitate machine learning as software by allowing dynamic addition of custom tests, through use of \n**tester** classes.\n\n## How to use\nSee the **examples** folder.\n\nRun `python -m examples.basic_regression_trainer_example` to see an autoencoder \ntrained by the `BasicRegressionTrainer` at the task of learning the identity mapping, f(x)=x.\n\n\n### Trainer\nThe main implementation in tfShell2 are *trainer* classes. These classes implement the logic for training your models, \nreporting their performance, and saving models. Implemented trainers are in `src.trainer`\n\nThe basic structure of the training process is housed in `BaseTrainer`. As this process differs for different models, it \nis not possible to have a one-trainer-fits-all solution. This base class outlines the methods which all trainers must have, such as a loss function.\n\nCommonly used training structures will be implemented in this codebase, however to create a different trainer, start by inheriting\nfrom `BaseTrainer` and implemented the abstract methods.\n\n*Note: trainers currently only print results to the command line. reporting to tensorboard, and saving models, is coming soon.*\n\n### Testers\n*Tester* classes facilitate easy application of an oft-overlooked part of machine learning: unit testing.\nThe tester classes can dynamically add any number of unit tests. Currently, the implementation of testing does not utilise python's `unittest` module; instead, \"running\" the tests merely evaluates a statement to True or False. \n\nThe aim is to make the tester classes `unittest.TestCase` derivatives, to allow more expressive tests.\n\nAt the moment, the only test implemented is a check that a variable changes during testing. If this test fails, then the model is not training; this can occur due to a number of minor and otherwise hard to spot coding errors. Using this test, one can pinpoint the layer in which training stops.\n\nFurther work will introduce tests to check that your model converges, that it produces nonsense output for nonsense input, and allow for completely custom tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttitcombe%2Ftfshell2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttitcombe%2Ftfshell2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttitcombe%2Ftfshell2/lists"}