{"id":16818480,"url":"https://github.com/adilzouitine/outfit","last_synced_at":"2025-04-11T02:42:51.876Z","repository":{"id":57449883,"uuid":"194332836","full_name":"AdilZouitine/outfit","owner":"AdilZouitine","description":":dress: Tidy up your machine learning experiments","archived":false,"fork":false,"pushed_at":"2019-09-05T09:42:49.000Z","size":77,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T07:59:21.702Z","etag":null,"topics":["experiments","machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdilZouitine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-28T20:54:38.000Z","updated_at":"2023-09-14T13:48:28.000Z","dependencies_parsed_at":"2022-09-26T17:31:11.522Z","dependency_job_id":null,"html_url":"https://github.com/AdilZouitine/outfit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdilZouitine%2Foutfit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdilZouitine%2Foutfit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdilZouitine%2Foutfit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdilZouitine%2Foutfit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdilZouitine","download_url":"https://codeload.github.com/AdilZouitine/outfit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248331222,"owners_count":21085859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["experiments","machine-learning"],"created_at":"2024-10-13T10:50:14.497Z","updated_at":"2025-04-11T02:42:51.855Z","avatar_url":"https://github.com/AdilZouitine.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :dress: Outfit\n\nOutfit is a lightweight library to **tidy up** your machine learning experiments in a simple way.\n\nThe idea of Outfit is to store in your `Wardrobe` your parameters, output file, scores and features in order to be able to make a request and find out which are your best experimentation according to a given criterion.\n\n## How install outfit ?\n\n**PyPI**:\n\n```bash\npip install outfit\n```\n\n**Dev version**: \n```bash\ngit clone https://github.com/AdilZouitine/outfit\ncd outfit\npip install -r requirements.txt\npip install -e .\n```\n\n\n## How outfit works ?\n\n\n- **Tutorial 1: Build a simple model management pipeline with outfit for a CNN with Pytorch on MNIST dataset** [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/17vJSQ9WRv1OeagyayXBq_eHs9H_Qg5JP) \n\n```python\n\nimport datetime\n\n# Here import all the libraries you need for your experiment\n\nfrom outfit import Wardrobe, getlog\n\nwardrobe = Wardrobe(db_path='foo/bar/mnist.db')\n\nexp = {\n    'experiment_name': 'ResNet18',\n    'comment': 'Use differential learning rate',\n    'date_experiment': datetime.datetime.now()\n}\n\nwardrobe.add_experiment(**exp)\n\nparam = {\n    'dropout': 0.20,\n    'kernel_size': '3x3',\n    'conv_block_1_lr': 0.01,\n    'conv_block_2_lr': 0.001\n   }\n\n# Create the instance of your model here with your parameters\nwardrobe.add_dict_parameter(param)\n\n\n# Do your training phase here.\noutput = {'training log': '/result/training_log_resnet18.txt'}\n\n@getlog(filepath=output['training log'])\ndef train_model(model, loaders, loss, lr_scheduler, n_epoch):\n    ...\n\noutput.update({\n    'tensorboard': '/result/event.tb',\n    'model': 'diff_lr_resnet18.pth'\n})\n\nwardrobe.add_dict_output(output)\n\nscore = {\n    'train acc': 0.96,\n    'train loss': 0.430,\n    'val acc': 0.94,\n    'val loss': 0.460\n     }\nwardrobe.add_dict_score(score)\n\n\nwardrobe.tidy() # commit your experiment in database\n\n```\n\n```python\n# If you want to get the best experiments \n\nfor exp in wardrobe.get_best_scores(mode='max',on_score='val acc'):\n    '''\n    Verbose is true by default and will print on the console \n    at each iteration the parameters, output file, \n    features and scores in a table format.\n\n    Also returns in dictionary the parameters, output file, features and scores.\n    '''\n    ...\n\n```\n**Output**:\n```\n════════════════════\n│ TOP 1 EXPERIMENT │\n════════════════════\n\n\n\nTable : Experiment \n\n╒════╤═════════════════╤═══════════════════╤════════════════════════════════╤════════════════════╕\n│    │   id_experiment │ experiment_name   │ comment                        │ date_experiement   │\n╞════╪═════════════════╪═══════════════════╪════════════════════════════════╪════════════════════╡\n│  0 │               1 │ ResNet18          │ Use differential learning rate │                    │\n╘════╧═════════════════╧═══════════════════╧════════════════════════════════╧════════════════════╛\n\n\nTable : Parameter \n\n╒════╤════════════════╤══════════════════╤═════════════╤══════════════╕\n│    │   id_parameter │ parameter_name   │ parameter   │   experiment │\n╞════╪════════════════╪══════════════════╪═════════════╪══════════════╡\n│  0 │              1 │ dropout          │ 0.2         │            1 │\n├────┼────────────────┼──────────────────┼─────────────┼──────────────┤\n│  1 │              2 │ kernel_size      │ 3x3         │            1 │\n├────┼────────────────┼──────────────────┼─────────────┼──────────────┤\n│  2 │              3 │ conv_block_1_lr  │ 0.01        │            1 │\n├────┼────────────────┼──────────────────┼─────────────┼──────────────┤\n│  3 │              4 │ conv_block_2_lr  │ 0.001       │            1 │\n╘════╧════════════════╧══════════════════╧═════════════╧══════════════╛\n\n\nTable : Output \n\n╒════╤═════════════╤═══════════════╤═══════════════════════════════════╤══════════════╕\n│    │   id_output │ type_output   │ path_output                       │   experiment │\n╞════╪═════════════╪═══════════════╪═══════════════════════════════════╪══════════════╡\n│  0 │           1 │ training log  │ /result/training_log_resnet18.txt │            1 │\n├────┼─────────────┼───────────────┼───────────────────────────────────┼──────────────┤\n│  1 │           2 │ tensorboard   │ /result/event.tb                  │            1 │\n├────┼─────────────┼───────────────┼───────────────────────────────────┼──────────────┤\n│  2 │           3 │ model         │ diff_lr_resnet18.pth              │            1 │\n╘════╧═════════════╧═══════════════╧═══════════════════════════════════╧══════════════╛\n\n\nTable : Score \n\n╒════╤════════════╤══════════════╤═════════╤══════════════╕\n│    │   id_score │ type_score   │   score │   experiment │\n╞════╪════════════╪══════════════╪═════════╪══════════════╡\n│  0 │          1 │ train acc    │    0.96 │            1 │\n├────┼────────────┼──────────────┼─────────┼──────────────┤\n│  1 │          2 │ train loss   │    0.43 │            1 │\n├────┼────────────┼──────────────┼─────────┼──────────────┤\n│  2 │          3 │ val acc      │    0.94 │            1 │\n├────┼────────────┼──────────────┼─────────┼──────────────┤\n│  3 │          4 │ val loss     │    0.46 │            1 │\n╘════╧════════════╧══════════════╧═════════╧══════════════╛\n\n\nTable : Feature \n\n```\n\n## Other solution:\n\n[mlflow](https://github.com/mlflow/mlflow) \u0026 [dvc](https://github.com/iterative/dvc).\n\nThese solutions are great, they also offer a user interface and have many more options than my library however for a simple use where you only want to organize your experimentation and make a simple query.\nBoth solutions seem to be overkill.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadilzouitine%2Foutfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadilzouitine%2Foutfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadilzouitine%2Foutfit/lists"}