-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Micrograd example #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Micrograd example #116
Conversation
Love this, very, very cool! Also like the idea of using the |
@matdmiller thank you! As mentioned on Twitter, this example is really cool! I'll ask for a little patience :) since I'm currently traveling from PyCon and can't test/review with the right attention but will try to get to it tomorrow. |
Thanks @philippjfr and @fpliger! I'm happy to help in this small way. I'm excited to see where PyScript goes and I appreciate the all the work you're putting into it! I love the idea of more of your examples taking advantage of One other thought I had, was that it would be great if there was a way to run your examples without having to pull down the repo and run it using npm. Maybe your examples could be set up to run directly in Github Pages and directly linked from the repo. This wouldn't replace the npm option, but it would make it even easier for people to see what's possible in PyScript. |
@matdmiller that's great feedback and suggestions! Agree on many things you mentioned... and really like the idea of using PyScript itself in the docs /cc @jezdez @kevingoldsmith ) In regards to the examples, they are also currently available in pyscript.net/examples but we need to add that info to the website and promote not more. (The native todo app there has a know bug that's is now fixed in main). Thank you! Hope to merge this today. |
without issue. Ex: intead of <code>a > b</code>, you will see <code>(a).__gt__(b)</code> instead. <br> | ||
</p> | ||
<p> | ||
<py-script>import js; js.document.getElementById('python-status').innerHTML = 'Python is now ready. You may proceed.'</py-script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can actually be replaced with
Element('python-status').write('Python is now ready. You may proceed.')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This demo is really cool! It had a few glitches for me but all I saw was probably related to issues in PyScript itself.
@philippjfr raised a great about how we want to structure demo, etc... I'd say that it's more of a problem with us not being fully prepared with a clear process on how to contribute examples and so.
@matdmiller if you don't mind the idea that we'll have to tweak this demo later or that it may even need to be moved elsewhere, I'd lean more towards action and propose that we merge. (it's also not linked in the index file yet, which lets us work on some of the bugs that I saw and add it to the index later with a better strategy on how we add new demos)
@fpliger that sounds good! I definitely have no problems with any edits you may want or need to do. No worries about it not being linked on the index page yet either. I wasn't sure if I should do that or not. The only preference I have is that you keep some sort of attribution (I'm totally fine if the format/method of it needs to change) in this example to Andrej Karpathy who was the author of micrograd and the demo notebook I adapted for this example. Also, thanks for the tip above on the cleaner way to update the text content of the div. This is my first ever open source PR so I'm not sure if I need to do anything to modify that before this gets merged or not. You all have been very kind and I appreciate the opportunity to contribute! |
That's awesome! 🍻 to your first contribution to Open Source! We'll definitely keep the attribution and thank you for the kind words! |
Added micrograd to the examples directory. This includes micrograd_ai.html and micrograd_ai.py. These files demonstrate training a basic model using the micrograd package which was created by Andrej Karpathy. This example was derived from the demo notebook in the micrograd repo (https://github.com/karpathy/micrograd/).