layout | title | permalink | published | verbose_header |
---|---|---|---|---|
default |
Art with Math |
/art_with_math |
true |
false |
Yunus Emre says "I am the drop that contains the ocean". It may be the case that a limited set of rules is responsible for everything around us. They may apply in various scales over and over again.
I like imagining Yunus Emre's ocean as a fractal. I came up with this fractal using the below recurrence relation:
Perona-Malik diffusion is a well known regularization technique that preserves the edges while smoothing down the texture. It is simply defined as:
where
where
During the minimization, we normally use a constant kernel to calculate the gradients (i.e. the Laplace operator for
The amount of flexibility and ease of use makes PyTorch a great choice for both research and prototyping. Moreover, it is quite easy to use PyTorch for things other than deep learning where you still need GPU acceleration; hence my experiments on Perona-Malik!
I started implementing a vanilla version of Perona-Malik using PyTorch, where I initialized a convolutional layer as my Laplace operator. The convolutional kernel is initialized as below:
[0.0, 1.0, 0.0]
[1.0, -4.0, 1.0]
[0.0, 1.0, 0.0]
Thanks to the utilization of GPU, the speed I got from such a simple implementation was pleasant.
Yet, using PyTorch for nothing but GPU acceleration seemed like a waste, and although I had nothing against the good old Laplace operator, it just needed to.. uum accept change, and chill a bit! This allowed me to change the edge seeking property of
where