Notion - Update docs

This commit is contained in:
shiffman 2024-07-10 11:46:05 +00:00 committed by GitHub
parent ce4235a05a
commit 82d093fe9c
44 changed files with 19 additions and 26 deletions

View file

@ -165,7 +165,7 @@ let birdBrain = ml5.neuralNetwork(options);</pre>
<div data-type="example">
<h3 id="example-111-flappy-bird-clone">Example 11.1: Flappy Bird Clone</h3>
<figure>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/Pv-JlO0cl" data-example-path="examples/11_nn_ga/11_3_flappy_bird"><img src="examples/11_nn_ga/11_3_flappy_bird/screenshot.png"></div>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/Pv-JlO0cl" data-example-path="examples/11_nn_ga/11_1_flappy_bird"><img src="examples/11_nn_ga/11_1_flappy_bird/screenshot.png"></div>
<figcaption></figcaption>
</figure>
</div>
@ -439,7 +439,7 @@ child.mutate(0.01);</pre>
<div data-type="example">
<h3 id="example-112-flappy-bird-with-neuroevolution">Example 11.2: Flappy Bird with Neuroevolution</h3>
<figure>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/PEUKc5dpZ" data-example-path="examples/11_nn_ga/11_4_flappy_bird_neuro_evolution"><img src="examples/11_nn_ga/11_4_flappy_bird_neuro_evolution/screenshot.png"></div>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/PEUKc5dpZ" data-example-path="examples/11_nn_ga/11_2_flappy_bird_neuro_evolution"><img src="examples/11_nn_ga/11_2_flappy_bird_neuro_evolution/screenshot.png"></div>
<figcaption></figcaption>
</figure>
</div>
@ -506,7 +506,7 @@ for (let i = 0; i &#x3C; lifeSpan; i++) {
<div data-type="example">
<h3 id="example-113-smart-rockets-with-neuroevolution">Example 11.3: Smart Rockets with Neuroevolution</h3>
<figure>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/KkV4lTS4H" data-example-path="examples/11_nn_ga/10_5_smart_rockets_neuro_evolution"><img src="examples/11_nn_ga/10_5_smart_rockets_neuro_evolution/screenshot.png"></div>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/KkV4lTS4H" data-example-path="examples/11_nn_ga/11_3_smart_rockets_neuro_evolution"><img src="examples/11_nn_ga/11_3_smart_rockets_neuro_evolution/screenshot.png"></div>
<figcaption></figcaption>
</figure>
</div>
@ -641,7 +641,7 @@ function draw() {
<div data-type="example">
<h3 id="example-114-dynamic-neuroevolutionary-steering">Example 11.4: Dynamic Neuroevolutionary Steering</h3>
<figure>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/fZDfxxVrf" data-example-path="examples/11_nn_ga/10_6_neuro_evolution_steering_seek"><img src="examples/11_nn_ga/10_6_neuro_evolution_steering_seek/screenshot.png"></div>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/fZDfxxVrf" data-example-path="examples/11_nn_ga/11_4_neuro_evolution_steering_seek"><img src="examples/11_nn_ga/11_4_neuro_evolution_steering_seek/screenshot.png"></div>
<figcaption></figcaption>
</figure>
</div>
@ -749,7 +749,7 @@ function draw() {
<div data-type="example">
<h3 id="example-115-a-bloop-with-sensors">Example 11.5: A Bloop with Sensors</h3>
<figure>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/vCTMtXXSS" data-example-path="examples/11_nn_ga/10_7_creature_sensors"><img src="examples/11_nn_ga/10_7_creature_sensors/screenshot.png"></div>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/vCTMtXXSS" data-example-path="examples/11_nn_ga/11_5_creature_sensors"><img src="examples/11_nn_ga/11_5_creature_sensors/screenshot.png"></div>
<figcaption></figcaption>
</figure>
</div>
@ -879,7 +879,7 @@ class Creature {
<div data-type="example">
<h3 id="example-116-a-neuroevolutionary-ecosystem">Example 11.6: A Neuroevolutionary Ecosystem</h3>
<figure>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/IQbcREjUK" data-example-path="examples/11_nn_ga/10_8_neuroevolution_ecosystem"><img src="examples/11_nn_ga/10_8_neuroevolution_ecosystem/screenshot.png"></div>
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/IQbcREjUK" data-example-path="examples/11_nn_ga/11_6_neuroevolution_ecosystem"><img src="examples/11_nn_ga/11_6_neuroevolution_ecosystem/screenshot.png"></div>
<figcaption></figcaption>
</figure>
</div>

View file

@ -19,7 +19,3 @@ function draw() {
emitter.addParticle();
emitter.run();
}
function mousePressed(){
save('screenshot.png')
}

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="https://unpkg.com/ml5@1.0.1/dist/ml5.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta charset="utf-8" />
</head>

View file

@ -16,6 +16,7 @@ let start, end;
function setup() {
createCanvas(640, 240);
ml5.setBackend('cpu');
// Step 2: set your neural network options
let options = {
task: "classification",

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -10,8 +10,7 @@ class Bird {
task: "classification",
// change to "neuroEvolution" for next ml5.js release
noTraining: true
// neuroEvolution: true,
neuroEvolution: true,
});
}

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="https://unpkg.com/ml5@1.0.1/dist/ml5.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta charset="utf-8" />
</head>

View file

@ -3,12 +3,11 @@ let pipes = [];
function setup() {
createCanvas(640, 240);
ml5.tf.setBackend("cpu");
for (let i = 0; i < 200; i++) {
birds[i] = new Bird();
}
pipes.push(new Pipe());
ml5.tf.setBackend("cpu");
}
function draw() {

View file

@ -2,7 +2,7 @@
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>
<script src="https://unpkg.com/ml5@1.0.1/dist/ml5.min.js"></script>
<meta charset="utf-8" />
<title>Nature of Code Example 9.3: Smart Rockets</title>
<link rel="stylesheet" type="text/css" href="style.css" />

View file

@ -30,7 +30,7 @@ class Rocket {
inputs: 2,
outputs: 2,
task: "regression",
noTraining: true,
neuroEvolution: true,
});
}
}

View file

@ -14,8 +14,7 @@ class Creature {
inputs: 5,
outputs: 2,
task: "regression",
// neuroEvolution: true,
noTraining: true,
neuroEvolution: true,
});
}
}

View file

@ -2,7 +2,7 @@
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>
<script src="https://unpkg.com/ml5@1.0.1/dist/ml5.min.js"></script>
<meta charset="utf-8" />
<title>Nature of Code Example 9.3: Smart Rockets</title>
<link rel="stylesheet" type="text/css" href="style.css" />

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -24,8 +24,7 @@ class Creature {
inputs: this.sensors.length,
outputs: 2,
task: "regression",
noTraining: true,
// neuroEvolution: true,
neuroEvolution: true,
});
}
}

View file

@ -2,7 +2,7 @@
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>
<script src="https://unpkg.com/ml5@1/dist/ml5.min.js"></script>
<meta charset="utf-8" />
<title>Nature of Code Example 9.3: Smart Rockets</title>
<link rel="stylesheet" type="text/css" href="style.css" />