{"id":15906876,"url":"https://github.com/gexarcha/dsc","last_synced_at":"2025-04-02T23:26:41.363Z","repository":{"id":70805560,"uuid":"140565198","full_name":"gexarcha/dsc","owner":"gexarcha","description":"Software implementation of the algorithm and experiments in the Discrete Sparse Coding paper","archived":false,"fork":false,"pushed_at":"2019-06-19T09:36:08.000Z","size":93,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T13:43:06.800Z","etag":null,"topics":["discrete-sparse-coding","machine-learning","sparse-representations"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"afl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gexarcha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-07-11T11:22:24.000Z","updated_at":"2019-06-19T09:36:10.000Z","dependencies_parsed_at":"2023-02-22T06:01:11.225Z","dependency_job_id":null,"html_url":"https://github.com/gexarcha/dsc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gexarcha%2Fdsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gexarcha%2Fdsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gexarcha%2Fdsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gexarcha%2Fdsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gexarcha","download_url":"https://codeload.github.com/gexarcha/dsc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246908054,"owners_count":20853185,"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":["discrete-sparse-coding","machine-learning","sparse-representations"],"created_at":"2024-10-06T13:42:03.984Z","updated_at":"2025-04-02T23:26:41.281Z","avatar_url":"https://github.com/gexarcha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Introduction\n\nThis package contains all the source code to reproduce the numerical\nexperiments described in the paper [Discrete Sparse Coding](https://gexarcha.github.io/files/papers/NECO-09-16-2696R2-PDF.pdf). \n\n## Software dependencies\n \n * Python (\u003e= 2.6)\n * NumPy (reasonably recent)\n * SciPy (reasonably recent)\n * pytables (reasonably recent)\n * mpi4py (\u003e= 1.3)\n\n## Overview \n\n* pulp/       - Python library/framework for MPI parallelized \n              EM-based algorithms. The models' implementations\n              can be found in pulp/em/camodels/.\n\n* examples/   - Small examples for initializing and running the models\n\n\n\n## Running\n\nTo run the barstest experiment:\n```bash\n  $ cd examples/barstest\n  $ python dsc_run.py\n```\nTo run the natural images experiment:\n```bash \n  $ cd ../natims\n  $ python dsc_run.py\n```\nTo run the spikes experiment:\n```bash\n  $ cd ../spikes\n  $ python dsc_on_hc1_run.py\n```\nTo run the audio experiment:\n```bash\n  $ cd ../audio\n  $ python dsc_run_audio.py\n```\nSome of this experiments are too big to run in a single workstation\nand should be executed on a cluster. Running our experiments on the \ncluster largely depends on the configuration. Example batch files \nfor our cluster (slurm based) configuration (GOLD cluster - Uni Oldenburg) are\ngiven in examples/\u003cexperiment name\u003e/batchscript.sh\n\n## Results/Output \n\nThe results produced by the code are stored in a 'results.h5' file \nunder \"./output/.../\". The file stores the model parameters (e.g., W, pi etc.) \nfor each EM iteration performed. To read the results file, you can use\nopenFile function of the standard tables package in python. Moreover, the\nresults files can also be easily read by other packages such as Matlab etc.\n\n## Running on a parallel architecture\n\nThe code uses MPI based parallelization. If you have parallel resources\n(i.e., a multi-core system or a compute cluster), the provided code can make a \nuse of parallel compute resources by evenly distributing the training data \namong multiple cores.\n\nTo run the same script as above, e.g., \n\na) On a multi-core machine with 32 cores:\n```bash\n $ mpirun -np 32 python dsc_run.py\n```\nb) On a cluster:\n```bash\n $ mpirun --hostfile machines python dsc_run.py\n```\n where 'machines' contains a list of suitable machines.\n\nSee your MPI documentation for the details on how to start MPI parallelized \nprograms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgexarcha%2Fdsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgexarcha%2Fdsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgexarcha%2Fdsc/lists"}