{"id":13994117,"url":"https://github.com/DwangoMediaVillage/keras_compressor","last_synced_at":"2025-07-22T18:33:29.632Z","repository":{"id":70153705,"uuid":"91796116","full_name":"DwangoMediaVillage/keras_compressor","owner":"DwangoMediaVillage","description":"Model Compression CLI Tool for Keras.","archived":false,"fork":false,"pushed_at":"2019-05-09T17:35:00.000Z","size":20,"stargazers_count":156,"open_issues_count":11,"forks_count":37,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-13T10:58:25.953Z","etag":null,"topics":["deep-learning","keras","machine-learning","model-compression"],"latest_commit_sha":null,"homepage":"https://nico-opendata.jp/ja/casestudy/model_compression/index.html","language":"Python","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/DwangoMediaVillage.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-19T10:42:04.000Z","updated_at":"2025-01-20T10:51:26.000Z","dependencies_parsed_at":"2023-02-21T22:31:28.220Z","dependency_job_id":null,"html_url":"https://github.com/DwangoMediaVillage/keras_compressor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DwangoMediaVillage/keras_compressor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DwangoMediaVillage%2Fkeras_compressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DwangoMediaVillage%2Fkeras_compressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DwangoMediaVillage%2Fkeras_compressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DwangoMediaVillage%2Fkeras_compressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DwangoMediaVillage","download_url":"https://codeload.github.com/DwangoMediaVillage/keras_compressor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DwangoMediaVillage%2Fkeras_compressor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266552577,"owners_count":23947179,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["deep-learning","keras","machine-learning","model-compression"],"created_at":"2024-08-09T14:02:42.828Z","updated_at":"2025-07-22T18:33:25.473Z","avatar_url":"https://github.com/DwangoMediaVillage.png","language":"Python","funding_links":[],"categories":["Python","PROJECTS"],"sub_categories":["2023"],"readme":"# keras_compressor\nModel compression CLI tool for [keras](https://github.com/fchollet/keras).\n\n# How to use it\n\n## Requirements\n- Python 3.5, 3.6\n- Keras\n    - We tested on Keras 2.0.3 (TensorFlow backend)\n\n## Install\n```\n$ git clone ${this repository}\n$ cd ./keras_compressor\n$ pip install .\n```\n\n## Compress\nSimple example:\n```\n$ keras-compressor.py model.h5 compressed.h5\n```\n\nWith accuracy parameter `error`:\n```\n$ keras-compressor.py --error 0.001 model.h5 compressed.h5\n```\n\n## Help\n```\n$ keras-compressor.py --help                                                                               [impl_keras_compressor:keras_compressor]\nUsing TensorFlow backend.\nusage: keras-compressor.py [-h] [--error 0.1]\n                           [--log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}]\n                           model.h5 compressed.h5\n\ncompress keras model\n\npositional arguments:\n  model.h5              target model, whose loss is specified by\n                        `model.compile()`.\n  compressed.h5         compressed model path\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --error 0.1           layer-wise acceptable error. If this value is larger,\n                        compressed model will be less accurate and achieve\n                        better compression rate. Default: 0.1\n  --log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}\n                        log level. Default: INFO\n```\n\n# How compress it\n- low-rank approximation\n  - with SVD (matrix)\n  - with Tucker (tensor)\n\n# Examples\nIn example directory, you will find model compression of VGG-like models using MNIST and CIFAR10 dataset.\n\n```console\n$ cd ./keras_compressor/example/mnist/\n\n$ python train.py\n-\u003e outputs non-compressed model `model_raw.h5`\n\n$ python compress.py\n-\u003e outputs compressed model `model_compressed.h5` from `model_raw.h5`\n\n$ python finetune.py\n-\u003e outputs finetuned and compressed model `model_finetuned.h5` from `model_compressed.h5`\n\n$ python evaluate.py model_raw.h5\n$ python evaluate.py model_compressed.h5\n$ python evaluate.py model_finetuned.h5\n-\u003e output test accuracy and the number of model parameters\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDwangoMediaVillage%2Fkeras_compressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDwangoMediaVillage%2Fkeras_compressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDwangoMediaVillage%2Fkeras_compressor/lists"}