{"id":20074724,"url":"https://github.com/greenelab/shared-latent-space","last_synced_at":"2025-08-02T06:09:13.170Z","repository":{"id":79359857,"uuid":"133413267","full_name":"greenelab/shared-latent-space","owner":"greenelab","description":"Shared Latent Space VAE's","archived":false,"fork":false,"pushed_at":"2020-04-20T15:40:06.000Z","size":171039,"stargazers_count":26,"open_issues_count":18,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-23T00:26:40.506Z","etag":null,"topics":["analysis","autoencoder","machine-learning","methodology","variational-autoencoder"],"latest_commit_sha":null,"homepage":"","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/greenelab.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-14T19:46:20.000Z","updated_at":"2025-04-20T13:27:08.000Z","dependencies_parsed_at":"2023-03-12T07:49:56.016Z","dependency_job_id":null,"html_url":"https://github.com/greenelab/shared-latent-space","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/greenelab/shared-latent-space","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenelab%2Fshared-latent-space","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenelab%2Fshared-latent-space/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenelab%2Fshared-latent-space/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenelab%2Fshared-latent-space/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greenelab","download_url":"https://codeload.github.com/greenelab/shared-latent-space/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenelab%2Fshared-latent-space/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268340177,"owners_count":24234676,"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-08-02T02:00:12.353Z","response_time":74,"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":["analysis","autoencoder","machine-learning","methodology","variational-autoencoder"],"created_at":"2024-11-13T14:53:58.730Z","updated_at":"2025-08-02T06:09:13.162Z","avatar_url":"https://github.com/greenelab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shared Latent Space Variational Autoencoders\n\n## Motivation for application of Shared Latent SPace VAE's In Biology\n\nVariational Autoencoders are machine learning models which learn the distribution of the data in a latent space manifold.\nThis allows the model to be trained on unsuprivesed data, but learning to recreate the input data, and also allows the model to\ncreate new data that ressembles the original data by picking points in the lantent space manifold.\nShared Latent Space VAE's find relationships between two different domains and allow for transformations between the two.\nThey achieve this by linking the lantent space manifold between two different encoders and decoders.\nThis is particularly useful in Biology where we could use different data types as different 'views'\non the same biological problem.\nThe ability to transform between domains also allows us to transition between different data types.\n\n## Diagram of Model\n![Alt text](Shared_Latent_Space_VAE.png)\n\n## Usage\n\n### Computational Environment\n\nAll libraries and packages are handled by conda and specified in the `environment.yml` file.\nTo build and activate this enviroment, run:\n```\n#conda version 4.4.10\nconda env create --force --file environment.yml\n\nconda activate shared-latenet-space\n```\n\n### Running the Model\n\nThe pickle files for MNIST and ICVL are both too big to include on the repo.\nThey are publically available and I will later provide an easy way to download them that will be consistent among platforms.\nYou should consider changing the layout of the model, which is controlled in the intialization of the model_parameters object in main_file.py.\nYou can also control the noise level as a parameter to the train function also located inside main_file.py.\n\n### Changing Datasets\n\nIf the data set is one of the already included datasets, you need to change which implementation of DataSetInfoAbstract is called when defining the DataSetInfo object.\nAdditionally, you should consider changing the model layout, as outlined in Running the Model.\n\n### Adding More Datasets\n\nIf you want to add more Datasets, that is fully supported.\nCreate your own implementation of the DataSetInfoAbstract abstract class including a method for loading and visualizing.\nYou must return two training sets and two testing sets.\nYou do not have to return anything for visualization, so it is merely sufficent to define the function and return nothing.\nThus, you don't need to implement a visualization, but you must declare it to comply with the interface. \n\n## Files\n\n### `main_file.py`\n\nThis is the file which should be called.\nIt handles calling other files for loading and formating data.\nIt also calls upon shared_vae_class.py to create the model, train it, and generate data.\nAs work continues, this file will become more general and easier to work with.\nAs of now, if you are using your own data, you should create a file for it which impliments the DataSetInfoAbstract abtract class.\nThen create it in the file and the file should know how to interact with it.\n\nTo run the file, open command line and enter:\n```\npython main_file.py\n```\n\n### `shared_vae_class.py`\n\nThis file is the main class which hold the model.\nIt contains functions to compile, train, and generate from the model.\nThe model will take in a series of parameters which control size of layers, etc.\nThe model right now is very rigid in structure, but this may change.\nThere a 5 different models built inside here for the purposes of training, but they are hidden.\nThe generate function calls on the visualize function of the DataSetInfoAbstract class.\nThis will produce an image to help visualize how the model is working.\n\n### `model_objects.py`\n\nThis file contains the model_parameters class which is fed to the shared_vae_class when it is initialized.\n\n### `DataSetInfoAbstractClass.py`\n\nThis file is an abstract class which is used for any dataset specific functions such as loading and visualizing.\nThese are abstract functions, so a specific implimentation must be provided for the dataset.\n\n### `ICVL.py`\n\nThis is a specific implimentation of the DataSetInfoAbstract abstract class for the ICVL data.\nIt contains a load function which loads the data from a pickle file as well as a visualize function which produces images of the depth maps and knuckle maps.\nThe draw_hands function draws all of the lines between the joints in the hand as given by the dataset. \n\n### `MNIST.py`\n\nThis is a specific implimentation of the DataSetInfoAbstract abstract class for the MNIST data.\nIt contains a load function which loads the data from a pickle file as well as a visualize function which produces images of the regular MNIST digits and the inverse MNIST digits.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenelab%2Fshared-latent-space","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenelab%2Fshared-latent-space","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenelab%2Fshared-latent-space/lists"}