{"id":29777391,"url":"https://github.com/deezer/vmf-exploration","last_synced_at":"2025-07-27T11:04:33.598Z","repository":{"id":304089185,"uuid":"988622934","full_name":"deezer/vMF-exploration","owner":"deezer","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-22T20:37:14.000Z","size":420,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-11T07:23:11.544Z","etag":null,"topics":[],"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/deezer.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,"zenodo":null}},"created_at":"2025-05-22T20:29:37.000Z","updated_at":"2025-05-23T07:47:04.000Z","dependencies_parsed_at":"2025-07-11T07:23:45.779Z","dependency_job_id":"81a5c853-6fca-496f-8a29-214c3dfd1fc3","html_url":"https://github.com/deezer/vMF-exploration","commit_stats":null,"previous_names":["deezer/vmf-exploration"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/deezer/vMF-exploration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deezer%2FvMF-exploration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deezer%2FvMF-exploration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deezer%2FvMF-exploration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deezer%2FvMF-exploration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deezer","download_url":"https://codeload.github.com/deezer/vMF-exploration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deezer%2FvMF-exploration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267347334,"owners_count":24072656,"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-27T02:00:11.917Z","response_time":82,"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":[],"created_at":"2025-07-27T11:04:31.371Z","updated_at":"2025-07-27T11:04:33.585Z","avatar_url":"https://github.com/deezer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# von Mises-Fisher Exploration\nRepository for the Paper \"Exploring Large Action Sets with Hyperspherical\nEmbeddings using von Mises-Fisher Sampling\" published in the proceedings of the 42nd International Conference on Machine Learning (ICML 2025). \n\n![alt text](resources/3D_voronoi_exemple.png)\n\nThis paper introduces von Mises-Fisher exploration (vMF-exp), a scalable method for exploring large action sets in reinforcement learning problems where hyperspherical embedding vectors represent these actions. vMF-exp involves initially sampling a state embedding representation using a von Mises-Fisher distribution, then exploring this representation's nearest neighbors, which scales to virtually unlimited numbers of candidate actions.\nWe show that, under theoretical assumptions, vMF-exp asymptotically maintains the same probability of exploring each action as Boltzmann Exploration (B-exp), a popular alternative that, nonetheless, suffers from scalability issues as it requires computing softmax values for each action.\nConsequently, vMF-exp serves as a scalable alternative to B-exp for exploring large action sets with hyperspherical embeddings. \nExperiments on simulated data, real-world public data, and the successful large-scale deployment of vMF-exp on the recommender system of a global music streaming service empirically validate the key properties of the proposed method.\n\n\n# Experiments\nRequirements: implicit==0.6.1, matplotlib==3.6.2, pandas==1.5.2, psutil==5.9.4, pympler==1.0.1, scipy==1.7.3, seaborn==0.12.1, tables==3.7.0, tqdm==4.64.1.\n## Spherical Uniform Distribution\nThe script `src/uniform/compute_probas.py` will run Monte Carlo simulations estimating the probability for von Mises-Fisher exploration and Boltzmann exploration to sample an action with know similarity given a state vector. The result can then be plotted using `src/uniform/plot_probas.py` where it will be compared against the theoretical expressions of **Proposition 4.2** and **Proposition 4.4**.\nFor instance, to reproduce **Figure 2.a**, one can run the following command\n```\npython -m src.uniform.compute_probas  -k 1.0 -a 0.5 -d 4 -N 1000000 -bs 256 -nt 30000\n```\nwhich will run the corresponding Monte Carlo Simulations (~ 3 hours on an Nvidia GTX 1080), followed by the command\n```\npython -m src.uniform.plot_probas -path simulations/k=1.0_a=0.50_d=4_N=1000000_samples=7680000/\n```\nwhich will create a plot similar to the following one\n\n![alt text](resources/exemple_monte_carlo.png)\n\nand save in a sub-folder of /simulations/ named according to the chosen parameters.\n\n## Glove-25 Embeddings\n\n### Download data\n\nData can be found at https://nlp.stanford.edu/projects/glove/\nExperiences were run using the 25 dimensions embeddings provided.\nAfter the correct file is downloaded, Unzip it and place it into the empty folder \"dataset\" already created.\n\n### Compute probabilities for a given set of parameters\nThe script `src/glove-25/compute_probas.py` will run Monte Carlo simulations estimating the probability for von Mises-Fisher exploration and Boltzmann exploration to sample an action with known similarity given a state vector. All vectors are sampled from the Glove 25 dataset previously downloaded (see above). The result can then be plotted using `src/glove-25/plot_probas.py`.\n\nFor instance, to reproduce **Figure 2.a**, one can run the following command\n```\npython -m src.glove-25.compute_probas -k 1 -a 0.0 -n glove-25 -bs 3000 -nt 10000\n```\nwhich will run the corresponding Monte Carlo Simulations, followed by the command\n```\npython -m src.glove-25.plot_probas --path results/glove-25/k\\=1.0_a\\=0.00_samples\\=30000000/\n```\nwhich will create a plot similar to the following one\n\n![alt text](resources/plot_0.0.png)\n\nand save the probabilities in a sub-folder of /results/ named according to the chosen parameters.\n\n### Compare Boltmann and von-Mises Fisher Explorations for a range of values\nThe script `src/glove-25/compare_boltzmann_vs_vmf.py` will reproduce **Figure 1.a** and **Figure 1.b** for a specified range of values of \u003cV,A\u003e that must first be computed using `src/glove-25/compute_probas.py` with changing values of a (see above).\n\nFor instance, running `src/glove-25/compute_probas.py`  several times with values of a in [0.9,0.3,0.0,-0.3,-0.9] and then running\n```\npython -m src.glove-25.compare_boltzmann_vs_vmf --values 0.9,0.3,0.0,-0.3,-0.9\n```\nwill create the following two plots\n\n![alt text](resources/boltzmann_plot.png)\n![alt text](resources/vmf_plot.png)\n\n\n\n# Optionnal : Visual Representations\n## 3D and 2D Voronoï tessellations\nThe script `src/uniform/plot_voronoi_3D.py` will reproduce **Figure 1.b**, which is an exemple of the Voronoi tesselation of 51 vectors uniformly distributed on the 3D sphere.\nRunning the command\n```\npython -m src.uniform.plot_D_voronoi --shuffle\n```\nwill sample new vectors and result in a plot similar to the following\n\n![alt text](resources/3D_voronoi_exemple.png)\n\n## Normal Approximation\n\nThe script `plot_voronoi_2D.py` will reproduce the plot of **Figure 1.c**, which is an exemple of the Voronoi tesselation of 11 vectors uniformly distributed on the 2D circle.\nRunning the command\n```\npython -m src.uniform.plot_3D_voronoi --shuffle\n```\nwill sample new vectors and result in a plot similar to the following\n\n![alt text](resources/2D_voronoi_exemple.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeezer%2Fvmf-exploration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeezer%2Fvmf-exploration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeezer%2Fvmf-exploration/lists"}