# Define my own convolutional kernel/mask/filter in Flux.jl

**URL:** <https://discourse.julialang.org/t/define-my-own-convolutional-kernel-mask-filter-in-flux-jl/79090>\
**Category:** General Usage\
**Tags:** neural-network\
**Created:** [April 6, 2022, 12:29pm UTC](https://discourse.julialang.org/t/define-my-own-convolutional-kernel-mask-filter-in-flux-jl/79090 "2022-04-06T12:29:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pijus](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@Pijus](https://discourse.julialang.org/u/Pijus)\
**Post date:** [April 6, 2022, 12:29pm UTC](https://discourse.julialang.org/t/define-my-own-convolutional-kernel-mask-filter-in-flux-jl/79090/1 "2022-04-06T12:29:17Z")

</div>

Hello all, I am trying to define my own convolutional kernels:  
For 1D case:  
[1 -2 1]  
For 2D case:  
| 0 1 0 |  
| 1 -4 1 |  
| 0 1 0 |  
Does anyone have any idea on how to do that in Flux.jl?  
You can only say how many kernels you want and how big are they, but I want to have these specific two.  
I could use some other library, but I am now working with Flux.  
Thank you!
