{"id":13627976,"url":"https://github.com/sunkwei/mxnet_tetris","last_synced_at":"2026-01-23T00:10:34.316Z","repository":{"id":75603578,"uuid":"123123566","full_name":"sunkwei/mxnet_tetris","owner":"sunkwei","description":"基于mxnet训练rnn网络, 玩俄罗斯方块","archived":false,"fork":false,"pushed_at":"2018-06-19T09:02:45.000Z","size":158,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-01T22:41:43.425Z","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/sunkwei.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}},"created_at":"2018-02-27T12:05:25.000Z","updated_at":"2021-03-28T16:28:28.000Z","dependencies_parsed_at":"2023-06-07T01:45:19.092Z","dependency_job_id":null,"html_url":"https://github.com/sunkwei/mxnet_tetris","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/sunkwei%2Fmxnet_tetris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunkwei%2Fmxnet_tetris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunkwei%2Fmxnet_tetris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunkwei%2Fmxnet_tetris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunkwei","download_url":"https://codeload.github.com/sunkwei/mxnet_tetris/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223735222,"owners_count":17194065,"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":[],"created_at":"2024-08-01T22:00:41.931Z","updated_at":"2026-01-23T00:10:34.289Z","avatar_url":"https://github.com/sunkwei.png","language":"Python","funding_links":[],"categories":["\u003ca name=\"Vision\"\u003e\u003c/a\u003e2. Vision"],"sub_categories":["2.14 Misc"],"readme":"# 训练rnn网络，自己玩俄罗斯方块\n通过训练一个GRU网络，学习“一个新的形状出现到形状不能动为止”的用户键盘操作序列，让模型自己玩俄罗斯方块游戏。\n\n## 基本思路\n俄罗斯方块本质是一个二位数组，这个可以认为是一个单通道的“image”，用户的键盘输入则是当前 image 下的“label”。\n\n因此可以有两种思路：\n\n - 图像分类：输入游戏的当前数组作为一副图像，输出的分类标签就是当前的键盘操作（左，右，下，旋转...）\n - rnn序列预测：从形状出现到结束，对应这一个用户键盘的操作序列，照理说，这种序列比静态的图像分类有更强的鲁棒性；\n\n## 尝试一下?\n\n### 生成样本:\n\n生成训练样本, 将在 rnn_train 子目录中生成大量npz文件, 每个npz中存储了图像+按键序列.\n\n\tpython game.py train\n\n生成测试样本\n\n\tpython game.py val\n\n### 训练\n\n\tpython train_rnn.py\n\n一个更好的方式是“在线训练”：\n\n\tpython game.py online\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunkwei%2Fmxnet_tetris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunkwei%2Fmxnet_tetris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunkwei%2Fmxnet_tetris/lists"}