Notion - Update docs
|
@ -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 < 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>
|
||||
|
|
|
@ -19,7 +19,3 @@ function draw() {
|
|||
emitter.addParticle();
|
||||
emitter.run();
|
||||
}
|
||||
|
||||
function mousePressed(){
|
||||
save('screenshot.png')
|
||||
}
|
|
@ -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>
|
||||
|
|
|
@ -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",
|
||||
|
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
@ -10,8 +10,7 @@ class Bird {
|
|||
task: "classification",
|
||||
|
||||
// change to "neuroEvolution" for next ml5.js release
|
||||
noTraining: true
|
||||
// neuroEvolution: true,
|
||||
neuroEvolution: true,
|
||||
});
|
||||
}
|
||||
|
|
@ -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>
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
@ -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() {
|
|
@ -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" />
|
|
@ -30,7 +30,7 @@ class Rocket {
|
|||
inputs: 2,
|
||||
outputs: 2,
|
||||
task: "regression",
|
||||
noTraining: true,
|
||||
neuroEvolution: true,
|
||||
});
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
@ -14,8 +14,7 @@ class Creature {
|
|||
inputs: 5,
|
||||
outputs: 2,
|
||||
task: "regression",
|
||||
// neuroEvolution: true,
|
||||
noTraining: true,
|
||||
neuroEvolution: true,
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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" />
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
@ -24,8 +24,7 @@ class Creature {
|
|||
inputs: this.sensors.length,
|
||||
outputs: 2,
|
||||
task: "regression",
|
||||
noTraining: true,
|
||||
// neuroEvolution: true,
|
||||
neuroEvolution: true,
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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" />
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |