{"id":25636281,"url":"https://github.com/pankajr141/som","last_synced_at":"2025-07-15T14:19:18.986Z","repository":{"id":57469277,"uuid":"127284162","full_name":"pankajr141/SOM","owner":"pankajr141","description":"This is python implementation for Kohonen Self Organizing map using numpy and tensor","archived":false,"fork":false,"pushed_at":"2018-09-09T14:30:05.000Z","size":15,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T21:54:02.495Z","etag":null,"topics":["clustering","gpu-computing","neural-network","self-organizing-map","tensorflow"],"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/pankajr141.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}},"created_at":"2018-03-29T11:49:35.000Z","updated_at":"2021-03-11T02:25:07.000Z","dependencies_parsed_at":"2022-09-19T10:11:00.768Z","dependency_job_id":null,"html_url":"https://github.com/pankajr141/SOM","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajr141%2FSOM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajr141%2FSOM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajr141%2FSOM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajr141%2FSOM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pankajr141","download_url":"https://codeload.github.com/pankajr141/SOM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968755,"owners_count":21191158,"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":["clustering","gpu-computing","neural-network","self-organizing-map","tensorflow"],"created_at":"2025-02-23T00:36:06.925Z","updated_at":"2025-04-14T21:54:17.119Z","avatar_url":"https://github.com/pankajr141.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SOM\nThis is python implementation for Kohonen Self Organizing map using numpy and tensor\n\n## Installtion\n\n**Python 3**\n`pip install somlib`\n\n## Usage\n\n1. Numpy implementation\n\n```\n\tfrom somlib import som\n\ts = som.SOM(neurons=(5,5), dimentions=3, n_iter=500, learning_rate=0.1)\n\ts.train(samples)  # samples is a n x 3 matrix\n\tprint(\"Cluster centres:\", s.weights_)\n\tprint(\"labels:\", s.labels_)\n\tresult = s.predict(samples)\n```\n\nHere 5,5 is the dimention of neurons, 3 is the number of features. samples is numpy array with each sample a 3 dimentional vector\n\n2. Tensor implementation\n\n```\n\tfrom somlib import som\n\ts = SOM(neurons=(5,5), dimentions=3, n_iter=500, learning_rate=0.1, mode=\"tensor\")\n\ts.train(samples)  # samples is a n x 3 matrix\n\tprint(\"Cluster centres:\", s.weights_)\n\tprint(\"labels:\", s.labels_)\n\tresult = s.predict(samples)\n```\n\n### Display clusters\nTo display clusters after training use this\n\n```s.displayClusters(samples)```\n\n\n![clusters](https://image.ibb.co/hS4uCH/figure_3.png \"Clusters\")","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajr141%2Fsom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpankajr141%2Fsom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajr141%2Fsom/lists"}