Skip to main content

Jupyter Notebook + Space Invaders!?

Project description


TrainInvaders
Train Invaders

Jupyter Notebook + Space Invaders!?

PyPI download monthly Python version Python version License

Why?Getting startedHow it worksFAQDrawbacksContributeThanks toYou may also like...

Demo

Why❓

Training a model can be a long long process!

In the meantime, have a bit of fun with a competitive space invaders game.

See if you can get your name to the top of the leaderboard.

Getting started 🏁

  1. Install the game: !pip3 install train_invaders --upgrade
  2. Import the game in your notebook: import train_invaders.start
  3. Start training your model. The game will automatically pop up when the process begins.
  4. Play the game! You'll get notified when your training is finished.
  5. Want to stop the game from popping up when the model is being trained? import train_invaders.stop will do the work.

How it works ⚙️

Tons of magic... Just kidding :)

When importing the start module, its code will be executed.

The code utilizes python's settrace function which follows the functions' call stack.

When 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.

When importing the stop module, the settrace function will be canceled and the function hooks will be removed.

FAQ 🙋

Will it interfere with the training process somehow?

NO. The game will start and be played in parallel to the training and will even let you know when the training is finished.

Drawbacks 🥺

  • Training stop indication is only in Jupyter Notebook. Want to get notified by email or text? Try MLNotify
  • Authentication, and therefore, saving your score can only be done from localhost and port 8888 - 8891 / 8080 / 8081

Contribute 🤝

Have an awesome idea for a new feature? PRs are more than welcome!

  1. Clone the project
  2. Run make build-game to get a local and compiled copy of the game (if not exists)
  3. Enter src/view directory and run npm run serve to run the local environment
  4. Implement your ideas
  5. Made changes in the game (C files)? Re-run make build-game from root dir and check them out
  6. Enter root directory, run make build, pip install . --upgrade and test the changes in your notebook
  7. PR us!

Thanks to 🙏

JanSiebert for the WebAssembly game.

Cody Boisclair for the PressStart2P font.

Vue for the awesome FE framework.

You may also ❤️

Aporia - Customized monitoring for your ML models.

MLNotify - Get notified when training is complete.

MLOps Toys - A curated list of useful MLOps tools.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

train_invaders-1.0.4.tar.gz (254.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

train_invaders-1.0.4-py3-none-any.whl (251.9 kB view details)

Uploaded Python 3

File details

Details for the file train_invaders-1.0.4.tar.gz.

File metadata

  • Download URL: train_invaders-1.0.4.tar.gz
  • Upload date:
  • Size: 254.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.8.12 Linux/5.8.0-1042-azure

File hashes

Hashes for train_invaders-1.0.4.tar.gz
Algorithm Hash digest
SHA256 6ff88dc6f2c2719dba70625d553d5d5a9f031b224c38fa73533563545fd1840f
MD5 5460efe2f6a2a85575bea10b0c0f1c16
BLAKE2b-256 e0af828d433db086498e25afbbba67ab24c3830f6488bad2d58b4557f486a715

See more details on using hashes here.

File details

Details for the file train_invaders-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: train_invaders-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 251.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.8.12 Linux/5.8.0-1042-azure

File hashes

Hashes for train_invaders-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5cca12e34d7d6152ce2e934df0635d0f0d35263d6dc7e075c0d29ee1834f4471
MD5 cced4b95d97e15b814c8ef60ccdb4c1f
BLAKE2b-256 fabcbff52c6227c92697bb2a931fd87f066bccf4dbf579586631ef658e17c747

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page