{"id":13699247,"url":"https://github.com/aporia-ai/TrainInvaders","last_synced_at":"2025-05-04T16:32:42.055Z","repository":{"id":41144293,"uuid":"408153367","full_name":"aporia-ai/TrainInvaders","owner":"aporia-ai","description":"👾 Jupyter Notebook + Space Invaders!?","archived":false,"fork":false,"pushed_at":"2021-11-03T10:39:47.000Z","size":14760,"stargazers_count":93,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-02T06:22:03.301Z","etag":null,"topics":["ai","jupyter-notebook","machine-learning","neural-network","python","space-invaders","webassembly"],"latest_commit_sha":null,"homepage":"","language":"C","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/aporia-ai.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":"2021-09-19T14:46:05.000Z","updated_at":"2024-01-27T09:29:27.000Z","dependencies_parsed_at":"2022-09-09T05:41:27.569Z","dependency_job_id":null,"html_url":"https://github.com/aporia-ai/TrainInvaders","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aporia-ai%2FTrainInvaders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aporia-ai%2FTrainInvaders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aporia-ai%2FTrainInvaders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aporia-ai%2FTrainInvaders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aporia-ai","download_url":"https://codeload.github.com/aporia-ai/TrainInvaders/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224398823,"owners_count":17304661,"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":["ai","jupyter-notebook","machine-learning","neural-network","python","space-invaders","webassembly"],"created_at":"2024-08-02T20:00:28.179Z","updated_at":"2024-11-13T05:30:24.005Z","avatar_url":"https://github.com/aporia-ai.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/aporia-ai/TrainInvaders/main/src/assets/logo.png\" alt=\"TrainInvaders\" width=\"200\"\u003e\n  \u003cbr\u003e\n    Train Invaders\n    \u003ca href=\"https://twitter.com/intent/tweet?text=Jupyter%20Notebook%20%2B%20Space%20Invaders%3F!%20Something%20fun%20to%20do%20while%20training%20your%20model%20%F0%9F%91%BE\u0026url=https://github.com/aporia-ai/TrainInvaders\u0026hashtags=MachineLearning,JupyterNotebook,DataScience,TrainInvaders\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge\u0026logo=twitter\u0026logoColor=white\" width=\"70\"\u003e\n    \u003c/a\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eJupyter Notebook + Space Invaders!?\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-+3.6-blue.svg\"\n         alt=\"Python version\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/contributions-welcome-orange.svg\"\n         alt=\"Python version\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-green.svg\"\n         alt=\"License\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#why\"\u003eWhy?\u003c/a\u003e •\n  \u003ca href=\"#getting-started-\"\u003eGetting started\u003c/a\u003e •\n  \u003ca href=\"#how-it-works-%EF%B8%8F\"\u003eHow it works\u003c/a\u003e •\n  \u003ca href=\"#faq-\"\u003eFAQ\u003c/a\u003e •\n  \u003ca href=\"#drawbacks-\"\u003eDrawbacks\u003c/a\u003e •\n  \u003ca href=\"#contribute-\"\u003eContribute\u003c/a\u003e •\n  \u003ca href=\"#thanks-to-\"\u003eThanks to\u003c/a\u003e •\n  \u003ca href=\"#you-may-also-%EF%B8%8F\"\u003eYou may also like...\u003c/a\u003e\n\u003c/p\u003e\n\n![Demo](https://raw.githubusercontent.com/aporia-ai/TrainInvaders/main/src/assets/demo.gif)\n\n## Why❓\n*Training a model can be a long long process!*\n\nIn the meantime, have a bit of fun with a **competitive space invaders game**.\n\nSee if you can get your name to the top of the *leaderboard*.\n\n## Getting started 🏁\n1. Install the game:\n`!pip3 install train_invaders --upgrade`\n2. Import the game in your notebook:\n`import train_invaders.start`\n3. Start training your model. The game will automatically pop up when the process begins.\n4. **Play the game!** *You'll get notified when your training is finished*.\n5. Want to stop the game from popping up when the model is being trained?\n`import train_invaders.stop` will do the work.\n\n## How it works ⚙️\n**Tons of magic**... Just kidding :)\n\nWhen importing the `start` module, its code will be executed.\n\nThe code utilizes python's `settrace` function which follows the functions' call stack.\n\nWhen a function named `fit` `train` or `train_on_batch` is called - using Jupyter notebook's kernel, aka, `IPython`, a javascript view code will be injected inside the output block as an `iframe` to keep it completely **isolated from your code**.\n\nWhen importing the `stop` module, the `settrace` function will be canceled and the function hooks will be removed.\n\n## FAQ 🙋\n### Will it interfere with the training process somehow?\n\nNO. The game will start and be played **in parallel to the training** and will even *let you know when the training is finished*.\n\n## Drawbacks 🥺\n* Training stop indication is only in Jupyter Notebook. Want to get notified by email or text? Try [MLNotify](https://mlnotify.aporia.com/?utm_source=train-invaders\u0026utm_medium=docs\u0026utm_campaign=train-invaders)\n* Authentication, and therefore, saving your score can only be done from `localhost` and port `8888 - 8891 / 8080 / 8081`\n\n## Contribute 🤝\nHave an awesome idea for a new feature? PRs are more than welcome!\n\n1. Clone the project\n2. Run `make build-game` to get a local and compiled copy of the game (if not exists)\n2. Enter `src/view` directory and run `npm run serve` to run the local environment\n2. Implement your ideas\n3. Made changes in the game (C files)? Re-run `make build-game` from root dir and check them out\n5. Enter root directory, run `make build`, `pip install . --upgrade` and test the changes in your notebook\n6. PR us!\n\n## Thanks to 🙏\n[JanSiebert](https://github.com/JanSiebert/wasm-space-invaders) for the WebAssembly game.\n\n[Cody Boisclair](https://github.com/codeman38) for the PressStart2P font.\n\n[Vue](https://github.com/vuejs/vue) for the awesome FE framework.\n\n## You may also ❤️\n[Aporia](https://www.aporia.com?utm_source=github\u0026utm_medium=github\u0026utm_campaign=train-invaders) - Customized monitoring for your ML models.\n\n[MLNotify](https://www.mlnotify.aporia.com?utm_source=github\u0026utm_medium=github\u0026utm_campaign=train-invaders) - Get notified when training is complete.\n\n[MLOps Toys](https://www.mlops.toys?utm_source=github\u0026utm_medium=github\u0026utm_campaign=train-invaders) - A curated list of useful MLOps tools.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faporia-ai%2FTrainInvaders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faporia-ai%2FTrainInvaders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faporia-ai%2FTrainInvaders/lists"}