CodingTrain / CodingTrain/Suggestion-Box

Water ripples in tf.js

Aperta
#963 6 commenti 0 reazioni 1 assegnatario Rivendicata da @shiffman Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
570
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

During live session I've noticed, that this pseudo-code
```
for every non-edge element:
loop
Buffer2(x, y) = (Buffer1(x - 1, y) +
Buffer1(x + 1, y) +
Buffer1(x, y + 1) +
Buffer1(x, y - 1)) / 2 - Buffer2(x, y)
Buffer2(x, y) = Buffer2(x, y) * damping
end loop
```
can be rewritten in terms of matrices:
```
Buffer2 = conv2d(Buffer1, kernel) - Buffer2
Buffer2 *= damping
```
where `kernel` is a 3*3 matrix of the following
```
[[0.0 0.5 0.0],
[0.5 0.0 0.5],
[0.0 0.5 0.0]]
```
Perhaps, it would be easier to explain what is convolution on this example

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.