{"id":16009445,"url":"https://github.com/fwcd/mini-ml","last_synced_at":"2026-03-03T09:08:45.477Z","repository":{"id":48186546,"uuid":"171545453","full_name":"fwcd/mini-ml","owner":"fwcd","description":"Computation graphs, automatic differentiation and machine learning for Kotlin","archived":false,"fork":false,"pushed_at":"2019-08-06T00:01:25.000Z","size":231,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-15T16:40:08.651Z","etag":null,"topics":["autograd","computation-graph","gradient","machine-learning","tensor"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwcd.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}},"created_at":"2019-02-19T20:34:50.000Z","updated_at":"2024-04-03T18:31:25.000Z","dependencies_parsed_at":"2022-08-26T00:23:11.459Z","dependency_job_id":null,"html_url":"https://github.com/fwcd/mini-ml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fwcd/mini-ml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fmini-ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fmini-ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fmini-ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fmini-ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwcd","download_url":"https://codeload.github.com/fwcd/mini-ml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fmini-ml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30038672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T06:58:30.252Z","status":"ssl_error","status_checked_at":"2026-03-03T06:58:15.329Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["autograd","computation-graph","gradient","machine-learning","tensor"],"created_at":"2024-10-08T13:02:12.545Z","updated_at":"2026-03-03T09:08:45.461Z","avatar_url":"https://github.com/fwcd.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniML\nA lightweight computation graph library for machine learning written in pure Kotlin.\n\nMiniML optimizes mathematical expressions by backpropagating gradients through a dynamically created expression graph.\n\n## Example\nTraining a linear model:\n\n```kotlin\nval x = placeholder(zeros())\nval w = variable(randoms(-10.0, 10.0))\nval b = variable(randoms(-10.0, 10.0))\nval expected = x * 3.0\nval output = (w * x) + b\nval cost = (expected - output).square()\nval learningRate = 0.0001\nval writer = File(\"cost.dat\")\n    .also { it.createNewFile() }\n    .printWriter()\n\nfor (i in 0 until 2000) {\n    x.value = randoms(-10.0, 10.0)\n    val currentCost = cost.forward()\n    cost.clearGradients()\n    cost.backward()\n    w.apply(-w.gradient!! * learningRate)\n    b.apply(-b.gradient!! * learningRate)\n    writer.println(currentCost)\n}\n\nwriter.close()\n```\n\n![Cost function over time](examples/linearModelCost.png)\n\nIn addition to operator overloading, MiniML also supports modern Kotlin features such as destructuring declarations:\n\n```kotlin\nval (rowA, rowB) = matrixOf(\n    rowOf(2.0, 5.3, 7.8),\n    rowOf(0.0, 0.9, 1.1)\n)\nval (cellA, cellB, cellC) = rowA\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fmini-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwcd%2Fmini-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fmini-ml/lists"}