Create Interactive Neural Nets in the Browser with this simple JavaScript Library


Pencil Code is a simple JavaScript library for creating interactive neural nets in the browser. Its main purpose is to illustrate how neural networks work, but it can also be used to quickly train and deploy machine learning models.

Getting StartedPencil Code has two components: a runtime library (which you can download from GitHub) and an editor which you can use online.

To get started with Pencil Code, open the editor:

pencilcode.net/edit/demo

This loads a demo that you can run by clicking the play button at the bottom of the screen.

A few months ago I decided to jump into Deep Learning and Neural Networks. As a computer scientist who has worked on web applications for the past couple of years, I decided to write a library that allows people to create and train neural networks in their web browsers.

The result is Pencil Code, a JavaScript library that makes it easy for developers to create realtime neural network experiments in their browsers. This library is open source and available on Github.

So how does it work? The simplest example is the following:

Pencil code is a JavaScript library aimed at making neural networks easy to use. The library is written in vanilla javascript, so there is no need for any external dependencies. In this post we will see how to implement a simple neural network from scratch in javascript without using any external libraries.

This post assumes that you are familiar with the basics of machine learning and have an understanding of how a neural network works. It’s okay if you don’t, in that case I recommend that you read my previous post on neural networks.

Neural networks are used for solving complex problems such as those that are hard to program explicitly using traditional computer science techniques. They can be used for tasks like predicting the stock prices or for recognizing handwritten digits or for detecting faces in images.

Pencil Code is an educational project, not a production product.

Pencil Code is designed so that students can use it and learn programming in the browser. It has a code editor with syntax highlighting, the capacity to run code right in the browser window, and a community forum where you can share your programs. Pencil Code also allows you to create advanced programs using libraries of JavaScript functions and HTML5 canvas graphics.

The project was originally developed by Ollie Williams at the University of Chicago in 2012, with support from the National Science Foundation. He went on to be one of the original engineers for Khan Academy. Currently it is maintained by Dan Garcia at UC Berkeley and CS 10 teaching team members at UC Berkeley.

We hope you enjoy learning to program with Pencil Code!

I got a few requests to share the code behind the interactive neural network demo from last week. Here’s a stripped down version.

The network is trained with a genetic algorithm. You can train the network yourself and see how it performs, or skip straight to the end, and use the pretrained model.

Make sure you set the browser to fullscreen for this one!

This demo is entirely client side – no data will leave your computer.

Pencil Code is a collaborative programming environment for drawing, animation, music, and games.

Pencil Code is open source. It’s free to use in the classroom and at home.

Use Pencil Code to make art with code or to teach others how to program.*

Name:The Unreasonable Effectiveness of Recurrent Neural Networks

Pencil Code is a collaborative programming site for drawing, animation, music, and game design. It is inspired by Scratch. Pencil Code emphasizes tools for learning programming concepts like conditionals and loops. The live coding environment allows immediate execution of program edits. Online examples are just a click away; you can explore them and remix them to create your own programs.

Pencil Code is part of the Bootstrap Project.


Leave a Reply

Your email address will not be published. Required fields are marked *