iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📘

Chapter 2: Leveraging Processing - Visualizing the Invisible

に公開

In this chapter, we will prepare to "visualize" the state and movements of an AI on screen.

The AI won't be learning yet. However, by the time you finish this chapter, you will have acquired a powerful weapon:

"Seeing numbers and states with your own eyes."


Why is "visualizing" important?

Inside an AI, something is always happening:

  • Numerical values are changing
  • States are transitioning
  • Outputs are fluctuating

However, these are usually invisible.

That is why, in this book, we will intentionally visualize the invisible.

To do this, we will use Processing.


What is Processing? (A brief overview)

Processing is a tool that allows you to:

  • Easily
  • Create visuals and animations
  • Using code

It is neither a UI library nor a game engine.

Think of it as a tool for "drawing the state of AI's thoughts."


  • MYON
    "Another new language?"

  • EDiE
    "The appearance is different, but the underlying concepts are very simple."


Let's install Processing

First, access the official website:

Click Download on the homepage and select the version that matches your OS (Windows, macOS, or Linux).

Once downloaded, install (or extract) it and launch the application.


If you can launch it, you're halfway there

When you launch Processing, a screen with some initial code will appear.

You can leave it as it is, but here, we will just copy and paste everything to get it running.


Copy and paste is fine: Your first Processing sketch

Copy the entire code below and paste it into the Processing editor:

void setup() {
  size(400, 400);
}

void draw() {
  background(240);
  ellipse(mouseX, mouseY, 50, 50);
}

Once pasted, click the ▶ (Run) button at the top left.


Success criteria

It is a success if the following happens:

  • A window opens
  • As you move your mouse,
  • A circle follows it

  • MYON
    "...Isn't this fun?"

  • EDiE
    "Yes. And this is very important."


This is not yet an AI

I will be honest with you here as well:

  • It is not an AI
  • It is not learning
  • It is not making any decisions

However, this sketch is crucial because you have just understood the following through physical experience:

"When the state changes, the visual changes."


The screen becomes the "face" of the AI

From here on, we will draw the following on this screen:

  • Random numbers
  • Arrays
  • Weights
  • Results of learning

The circle you drew today will become:

The "state of the AI's thoughts" tomorrow.


Column: Why "visualize" numbers?

For humans, observing movement is far more intuitive than reading numbers.

The same applies to the inside of an AI:

  • Some can understand it through mathematical formulas
  • But others can understand it the moment they "see" it

This book is for the latter.


To the next chapter

In the next chapter, we will perform the following:

  • Send numbers created in Python
  • To the Processing screen

Connecting the "world of calculation" with the "world of vision."

It will finally start to feel like AI.

Discussion