-
Notifications
You must be signed in to change notification settings - Fork 2
/
grid.html
160 lines (150 loc) · 9.29 KB
/
grid.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!doctype html>
<meta charset="utf-8">
<script src="website/template.js"></script>
<script src="https://d3js.org/d3.v4.js"></script>
<script async src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-68SGYK1XFT"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-68SGYK1XFT');
</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.css" integrity="sha384-zTROYFVGOfTw7JV7KUu8udsvW2fx4lWOsCEDqhBreBwlHI4ioVRtmIvEThzJHGET" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.js" integrity="sha384-GxNFqL3r9uRJQhR+47eDxuPoNE7yLftQM8LcxzgS4HT73tp970WS/wV5p8UzCOmb" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"></script>
<script async>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
// customised options
// • auto-render specific keys, e.g.:
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
// • rendering keys, e.g.:
throwOnError : false
});
});
</script>
<script type="text/front-matter">
title: "Stopping Aging in Neural Cellular Automata"
description: "Description of the post"
authors:
- Lorenzo Cavuoti: https://github.com/LetteraUnica
- Francesco Sacco: http://github.com/Francesco215
affiliations:
- University of Trieste: http://units.it
- University of Pisa: http://unipi.it
</script>
<dt-article>
<h1>Stopping Aging in Neural Cellular Automata</h1>
<h2>
In this paper we are going to discuss the condition necessary to make a mortal
neural cellular automata, immortal
</h2>
<dt-byline></dt-byline>
<h1 id="realistic simulation of adversarials">Realistic simulation of adversarials</h1>
<p>
One of the limitations of using a fixed mask is that it can’t model what happens when a kind of cell
overtakes the other. This is important because having the new cells overtake the old ones would be both more biologically plausible
<dt-fn>because in biological organisms cells die and are replaced by new ones</dt-fn> and could
reduce the minimum percentage of initial cells that need to be switched.
In an ideal case, we would only substitute a small percentage of cells, then these would gradually overtake the entire organism,
making it immortal (<a href="#illutration_replacement">Figure 7</a>).
<dt-fn>
The minimum percentage required depends from the speed of the aging process, if it's slow
you can start with fewer cells since they will have plenty of time to overtake the old ones
</dt-fn>
</p>
<figure class="l-body" id="illutration_replacement">
<img src="pytorch_ca/images/Evoluzione.png" style='height: 100%; width: 100%; object-fit: contain'>
<figcaption style="align-self: center; margin-top: 20px; margin-bottom: 25px; width: 100%" >
Figure 7: The idea is that the new cells learn to overtake the old one and than make the organism immortal,
so you need to inject fewer cells in the new organism
</figcaption>
</figure>
<p>
To make this work we first have to ask ourselves how do we model the evolution of the mask?
</p>
<h3 id="model realistic simulation of adversarials">The Model</h3>
<figure class="l-middle side" id="evolving_mask">
<img src="pytorch_ca/images/Canali.svg" style='height: 300px; width: 100%; object-fit: contain'>
<figcaption style="margin-top: 20px; margin-bottom: 25px; width: 100%" >
Figure 9: The vector on the left represents the old represetation of the CA state, and the one
on the right is the new representation. This new representation of the cells has an additional
$\alpha$ channel and to make the code simpler the alpha channels are now the last two components
</figcaption>
</figure>
<p>
For simplicity we are going to restrict ourself in the case where we are going to have 2 rules ($f_1$ and $f_2$).
</p>
<p>
Before, a cell state was represented by a state vector having the first 4 components representing
the RGBA of the pixel and the remaining were hidden channels that helped the CA pass
information between its cells. If the $\alpha$ channel (transparency) is >0.1 it means
that the cell is alive, otherwise it’s dead
</p>
<p>
If we are going to have two different types of cells we are going to need two alpha channels.
Since a cell cannot be of both kinds at the same time we choose that if $\alpha_1$ is $>0.1$, then
$\alpha_2$ must be 0, and the cell update follows $f_1$ and vice versa.
</p>
<p>
At the same time, when both alphas are below $0.1$, the cell evolves with the average of both updates (<a href="#evolving_mask">Figure 8,9</a>).
</p>
<figure class="l-middle" id="evolving_mask" style="display: flex;">
<div style='height: 50%; width: 50%;' id="grid_container">
<div id="grid" style='position: relative; z-index: 1; height: 308px; width: 100%; object-fit: contain'></div>
<figcaption id="white">
Figure 8: The color of the cells in the image on the left represents the kind of cell.
Different kinds will have different evolution rules. Pass the mouse over the cells to see further details
</figcaption>
<figcaption id="red" style="display: none;">
The red cells have $\alpha_1>0.1$ and $\alpha_2=0$, and follow the rule $f_1$. They represent the cells that are alive and of kind 1.
</figcaption>
<figcaption id="yellow" style="display: none;">
The yellow cells have $\alpha_2>0.1$ and $\alpha_1=0$, and follow the rule $f_2$. They represent the cells that are alive and of kind 2.
</figcaption>
<figcaption id="light_red" style="display: none;">
The light red cells have $\alpha_1 \le 0.1$ and $\alpha_2=0$. They occupy the cells that are neighboring to the red cells, but do not neighbor the yellow cells. They follow $f_1$
</figcaption>
<figcaption id="light_yellow" style="display: none;">
The light yellow cells have $\alpha_2 \le 0.1$ and $\alpha_1=0$. They occupy the cells that are neighboring to the yellow cells, but do not neighbor the red cells. They follow $f_2$
</figcaption>
<figcaption id="orange" style="display: none;">
The light orange cells have $\alpha_1 \le 0.1$ and $\alpha_2 \le 0.1$. They occupy the cells that are neighboring to both red and yellow cells but are not alive in either. They follow the average of both rules
</figcaption>
<div id="frame" style="position:absolute; width: 2000px; height: 1000px; margin-left: -300px; margin-top:-600px;"></div>
</div>
<div style='float:right; height: 50%; width: 50%; position: relative; color: grey; font-size: 13px; line-height: 1.5em; font-family: sans-serif; margin-top: 0.5em;'>
<p id="explanation 1" style="font-family: inherit; margin-top: inherit; margin-bottom: inherit;">
A cell can be alive in only one channel, you can’t have a live cell that behaves like both, this means that no cell must have both $\alpha_\textrm s$ greater than $0.1$. This is because if we interpret the two cells as having different DNA, then they must have different rules and there is no in-between
</p>
<p id="explanation 2" style="font-family: inherit; margin-top: inherit; margin-bottom: inherit;">
We impose that new cells can only grow near mature ones of the same type, example: cells of type 2 can only grow near cells of type 2 </p>
<p id="explanation 3" style="font-family: inherit; margin-top: inherit; margin-bottom: inherit;">
Unless the space is already occupied by another cell
</p>
<p id="explanation 4" style="font-family: inherit; margin-top: inherit; margin-bottom: inherit;">
If we do the same reasoning for the red cells we get this
</p>
<p id="explanation 5" style="font-family: inherit; margin-top: inherit; margin-bottom: inherit;">
If you look closely there are some orange squares, they are a combination of light yellow and light red, this means that these squares neighbors both the kind of live cells, but are not alive.
These orange squares have both $\alpha$ channels below 0.1 and they follow the average of both rules
</p>
</div>
</figure>
<p>
Keep in mind that neither update rules can directly influence the neighboring cells directly, so the adversarial
is forced to rely on changing its internal state in such a way that the other cell's rule makes it kill itself
$$
f_{1,2}: \mathbb{R}^{9\times (n_\textrm{channels}-1)} \to \mathbb{R}^{n_\textrm{channels}-1}
$$
</p>
<script src="grid_value.js" type="text/javascript"></script>
<script src="grid_yellow_value.js" type="text/javascript"></script>
<script src="grid.js" type="text/javascript"></script>