CodingTrain / CodingTrain/Suggestion-Box
Water ripples in tf.js
- Dominant language
- No language data
- Stars
- 570
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.