{"id":19091975,"url":"https://github.com/allencellmodeling/pytorch_integrated_cell","last_synced_at":"2025-04-30T11:53:05.587Z","repository":{"id":28132640,"uuid":"88887833","full_name":"AllenCellModeling/pytorch_integrated_cell","owner":"AllenCellModeling","description":"Integrated Cell project implemented in pytorch","archived":false,"fork":false,"pushed_at":"2022-11-22T02:57:54.000Z","size":130803,"stargazers_count":40,"open_issues_count":29,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-02-28T13:25:45.876Z","etag":null,"topics":["autoencoder","cell-analysis","cell-biology","generative-adversarial-network","machine-learning","neural-networks","python","pytorch","science-research"],"latest_commit_sha":null,"homepage":null,"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/AllenCellModeling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-20T16:33:57.000Z","updated_at":"2022-09-22T14:12:58.000Z","dependencies_parsed_at":"2022-07-27T12:32:31.395Z","dependency_job_id":null,"html_url":"https://github.com/AllenCellModeling/pytorch_integrated_cell","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2Fpytorch_integrated_cell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2Fpytorch_integrated_cell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2Fpytorch_integrated_cell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2Fpytorch_integrated_cell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllenCellModeling","download_url":"https://codeload.github.com/AllenCellModeling/pytorch_integrated_cell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223779692,"owners_count":17201307,"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":["autoencoder","cell-analysis","cell-biology","generative-adversarial-network","machine-learning","neural-networks","python","pytorch","science-research"],"created_at":"2024-11-09T03:17:42.392Z","updated_at":"2024-11-09T03:17:42.976Z","avatar_url":"https://github.com/AllenCellModeling.png","language":"Python","readme":"Pytorch 3D Integrated Cell\n===============================\n\n![Model Architecture](doc/images/model_arch.png?raw=true \"Model Architecture\")\n\nBuilding a 3D Integrated Cell: https://www.biorxiv.org/content/early/2017/12/21/238378\n\n### For the 2D manuscript and software:  \n\n**Generative Modeling with Conditional Autoencoders: Building an Integrated Cell**  \nManuscript: https://arxiv.org/abs/1705.00092  \nGitHub: https://github.com/AllenCellModeling/torch_integrated_cell \n\n## Todo Items\n- GIT\n    - [x] Remove old big files from git\n    \n- Jupyter notebooks  \n    - [x] Check-in current state to git\n    - [x] Make sure notebooks all run and can produce figures\n    - [x] Annotate notebooks (notebook purpose)\n    - [x] Clear outputs\n    - [x] Check-in final state to git\n    \n- Data\n    - [x] Make sure current Quilt data works\n    - [ ] Check-in manuscript data to Quilt\n\n- Code \n    - [x] Check-in current state to git\n    - [x] Clear unused code\n    - [ ] Clean up and annotate main functions\n    - [ ] Check-in final state to git\n\n- Demos/Docs\n    - [x] Installation instructions\n    - [x] Getting Started doc\n    - [ ] Demos for different training methods\n    - [ ] Update doc figures\n\n## Support\n\nThis code is in active development and is used within our organization. We are currently not supporting this code for external use and are simply releasing the code to the community AS IS. The community is welcome to submit issues, but you should not expect an active response.\n\n\n## System requirements\n\nWe recommend installation on Linux and an NVIDIA graphics card with 10+ GB of RAM (e.g., NVIDIA Titan X Pascal) with the latest drivers installed.\n\n## Installation\n\nInstalling on linux is recommended.\n\n- Install Python 3.6+/Docker/etc if necessary.\n- All commands listed below assume the bash shell.\n\n### **Installation method (A): In Existing Workspace**\n(Optional) Make a fresh conda repo. (This will mess up some libraries if inside a some of Nvidia's Docker images)\n```shell\nconda create --name pytorch_integrated_cell python=3.7\nconda activate pytorch_integrated_cell\n```\nClone and install the repo\n```shell\ngit clone https://github.com/AllenCellModeling/pytorch_integrated_cell\ncd pytorch_integrated_cell\npip install -e .\n```\n\nIf you want to do some development, install the pre-commit hooks:\n```shell\npip install pre-commit\npre-commit install\n```\n\n(Optional) Clone and install Nvidia Apex for half-precision computation\nPlease follow the instructions on the Nvidia Apex github page:\nhttps://github.com/NVIDIA/apex\n\n### **Installation method (B): Docker**\nWe build on Nvidia Docker images. In our tests this runs very slightly slower than (A) although your mileage may vary. This comes with Nvidia Apex.\n```shell\ngit clone https://github.com/AllenCellModeling/pytorch_integrated_cell\ncd pytorch_integrated_cell\ndocker build -t aics/pytorch_integrated_cell -f Dockerfile .\n```\n\n## Data\nData can be downloaded via Quilt T3. The following script will dump the complete 2D and 3D dataset into `./data/`. This may take a long time depending on your connection.\n```shell\npython download_data.py\n```\nThe dataset is about 250gb.\n\n## Training Models\nModels are trained by via command line argument. A typical training call looks something like:\n```shell\nic_train_model \\\n        --gpu_ids 0 \\\n        --model_type ae \\\n        --save_parent ./ \\\n        --lr_enc 2E-4 --lr_dec 2E-4 \\\n        --data_save_path ./data.pyt \\\n\t\t--imdir ./data/ \\\n        --crit_recon integrated_cell.losses.BatchMSELoss \\\n        --kwargs_crit_recon '{}' \\\n        --network_name vaegan2D_cgan \\\n        --kwargs_enc '{\"n_classes\": 24, \"ch_ref\": [0, 2], \"ch_target\": [1], \"n_channels\": 2, \"n_channels_target\": 1, \"n_latent_dim\": 512, \"n_ref\": 512}'  \\\n        --kwargs_enc_optim '{\"betas\": [0.9, 0.999]}' \\\n        --kwargs_dec '{\"n_classes\": 24, \"n_channels\": 2, \"n_channels_target\": 1, \"ch_ref\": [0, 2], \"ch_target\": [1], \"n_latent_dim\": 512, \"n_ref\": 512, \"output_padding\": [1,1], \"activation_last\": \"softplus\"}' \\\n        --kwargs_dec_optim '{\"betas\": [0.9, 0.999]}' \\\n        --kwargs_model '{\"kld_reduction\": \"mean_batch\", \"objective\": \"H\", \"beta\": 1E-2}' \\\n        --train_module cbvae2 \\\n        --dataProvider DataProvider \\\n        --kwargs_dp '{\"crop_to\": [160,96], \"return2D\": 1, \"check_files\": 0, \"make_controls\": 0, \"csv_name\": \"controls/data_plus_controls.csv\", \"normalize_intensity\": \"avg_intensity\"}' \\\n        --saveStateIter 1 --saveProgressIter 1 \\\n        --channels_pt1 0 1 2 \\\n        --batch_size 64  \\\n        --nepochs 300 \\\n```\n\nThis automatically creates a timestamped directory in the current directory `./`. \n\nFor details on how to modify training options, please see [the training documentation](doc/training.md)\n\n## Loading Modes\nModels are loaded via python API. A typical loading call looks something like:\n```python\nfrom integrated_cell import utils\n\nmodel_dir = '/my_parent_directory/model_type/date_time/'\nparent_dir = '/my_parent_directory/'\n\nnetworks, data_provider, args = utils.load_network_from_dir(model_dir, parent_dir)\n\ntarget_enc = networks['enc']\ntarget_dec = networks['dec']\n\n```\n\n`networks` is a dictionary of the model subcomponents.  \n`data_provider` is the an object that contains train, validate, and test data.  \n`args` is a dictionary of the list of aguments passed to the model\n\nFor details on how to modify training options, please see [the loading documentation](doc/loading.md)\n\n\n\n## Project website\nExample outputs of this model can be viewed at http://www.allencell.org.\n\n## Examples ##\nExamples of how to run the code can be found in the [3D benchmarks section](doc/benchmarks.md).\n\n## Citation\nIf you find this code useful in your research, please consider citing the following paper:\n\n    @article {Johnson238378,\n\tauthor = {Johnson, Gregory R. and Donovan-Maiye, Rory M. and Maleckar, Mary M.},\n\ttitle = {Building a 3D Integrated Cell},\n\tyear = {2017},\n\tdoi = {10.1101/238378},\n\tpublisher = {Cold Spring Harbor Laboratory},\n\tURL = {https://www.biorxiv.org/content/early/2017/12/21/238378},\n\teprint = {https://www.biorxiv.org/content/early/2017/12/21/238378.full.pdf},\n\tjournal = {bioRxiv}\n    }\n\t\t\t\n## Contact\nGregory Johnson\nE-mail: gregj@alleninstitute.org\n\n## License\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallencellmodeling%2Fpytorch_integrated_cell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallencellmodeling%2Fpytorch_integrated_cell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallencellmodeling%2Fpytorch_integrated_cell/lists"}