{"id":13713770,"url":"https://github.com/danaugrs/go-tsne","last_synced_at":"2025-04-30T01:30:56.394Z","repository":{"id":57493865,"uuid":"147255251","full_name":"danaugrs/go-tsne","owner":"danaugrs","description":"t-Distributed Stochastic Neighbor Embedding (t-SNE) in Go","archived":false,"fork":false,"pushed_at":"2023-12-10T17:52:11.000Z","size":94553,"stargazers_count":203,"open_issues_count":4,"forks_count":24,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-06-21T18:52:29.080Z","etag":null,"topics":["3d","data-science","dimensionality-reduction","go","machine-learning","tsne","unsupervised-learning","visualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danaugrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-09-03T21:27:53.000Z","updated_at":"2024-06-10T15:40:25.000Z","dependencies_parsed_at":"2024-06-18T15:25:08.959Z","dependency_job_id":null,"html_url":"https://github.com/danaugrs/go-tsne","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/danaugrs%2Fgo-tsne","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danaugrs%2Fgo-tsne/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danaugrs%2Fgo-tsne/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danaugrs%2Fgo-tsne/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danaugrs","download_url":"https://codeload.github.com/danaugrs/go-tsne/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213742334,"owners_count":15631916,"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":["3d","data-science","dimensionality-reduction","go","machine-learning","tsne","unsupervised-learning","visualization"],"created_at":"2024-08-02T23:01:43.966Z","updated_at":"2024-11-12T00:03:51.247Z","avatar_url":"https://github.com/danaugrs.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# go-tsne\n\nA Go implementation of [t-Distributed Stochastic Neighbor Embedding (t-SNE)](https://lvdmaaten.github.io/tsne/), a prize-winning technique for dimensionality reduction particularly well suited for visualizing high-dimensional datasets.\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"https://github.com/danaugrs/go-tsne/blob/master/examples/mnist2d/mnist2d.gif\" alt=\"mnist2d\" width=\"49%\" /\u003e\n  \u003cimg src=\"https://github.com/danaugrs/go-tsne/blob/master/examples/mnist3d/mnist3d.gif\" alt=\"mnist3d\" width=\"49%\" /\u003e \n\u003c/p\u003e\n\n### Usage\nImport this library:\n```Go\nimport \"github.com/danaugrs/go-tsne/tsne\"\n```\nCreate the TSNE object:\n```Go\nt := tsne.NewTSNE(2, 300, 100, 300, true)\n```\nThe parameters are\n* Number of output dimensions\n* Perplexity\n* Learning rate\n* Max number of iterations\n* Verbosity\n\nThere are two ways to start the t-SNE embedding optimization. The regular way is to provide an `n` by `d` matrix where each row is a datapoint and each column is a dimension:\n```Go\nY := t.EmbedData(X, nil)\n```\nThe alternative is to provide a distance matrix directly:\n```Go\nY := t.EmbedDistances(D, nil)\n```\nIn either case, the returned matrix `Y` will contain the final embedding.\n\nFor more fine-grained control, a step function can be provided in either case:\n```Go\nY := t.EmbedData(X, func(iter int, divergence float64, embedding mat.Matrix) bool {\n  fmt.Printf(\"Iteration %d: divergence is %v\\n\", iter, divergence)\n  return false\n})\n```\nThe step function has access to the iteration, the current divergence, and the embedding optimized so far.\nYou can return `true` to halt the optimization.\n\n### Examples\nTwo examples are provided - `mnist2d` and `mnist3d`. They both use the same data - a subset of [MNIST](http://yann.lecun.com/exdb/mnist/) with 2500 handwritten digits. `mnist2d` generates plots throughout the optimization process, and `mnist3d` shows the optimization happening in real-time, in 3D. `mnist3d` depends on [G3N](https://github.com/g3n/engine).\nTo run an example, `cd` to the example's directory, build it, and execute it, e.g:\n```\ncd examples/mnist2d\ngo build\n./mnist2d\n```\n\n### Support\nI hope you enjoy using and learning from go-tsne as much as I enjoyed writing it.\n\nIf you come across any issues, please [report them](https://github.com/danaugrs/go-tsne/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanaugrs%2Fgo-tsne","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanaugrs%2Fgo-tsne","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanaugrs%2Fgo-tsne/lists"}