# Custom Flux Layer Connect

**URL:** https://discourse.julialang.org/t/custom-flux-layer-connect/36262
**Category:** Machine Learning
**Tags:** package, flux
**Created:** [March 20, 2020, 1:13pm UTC](https://discourse.julialang.org/t/custom-flux-layer-connect/36262 "2020-03-20T13:13:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TobiS](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TobiS](https://discourse.julialang.org/u/TobiS)
#### Post date: [March 20, 2020, 1:13pm UTC](https://discourse.julialang.org/t/custom-flux-layer-connect/36262/1 "2020-03-20T13:13:56Z")

</div>

Hello everyone,

I would like to implement the architecture of N-BEATS network ([https://arxiv.org/pdf/1905.10437.pdf](https://arxiv.org/pdf/1905.10437.pdf)) in julia Flux. A simple example of a part of the architecture is shown in the following figure.

 ![NBeats_part](https://global.discourse-cdn.com/julialang/original/3X/4/8/4866f4feaeaffdb4a48603bcfeedc83c85491ec8.png)  
Is there a way to define the connections between the layers individually? For example connect one layer with 64 neurons to two other layers (96 and 32 neurons). The Flux.SkipConnection method does not seem to work here, as I only want to connect the input values to the first output of Block #1.

---

<div class="post-metadata">

### Author: ![mobar](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mobar](https://discourse.julialang.org/u/mobar)
#### Post date: [September 5, 2023, 7:56am UTC](https://discourse.julialang.org/t/custom-flux-layer-connect/36262/2 "2023-09-05T07:56:04Z")

</div>

Hi, did you manage to complete the implementation?

(looking to do the same thing)

---

<div class="post-metadata">

### Author: ![CarloLucibello](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carlolucibello/32/3278_2.png) [@CarloLucibello](https://discourse.julialang.org/u/CarloLucibello)
#### Post date: [September 5, 2023, 8:31am UTC](https://discourse.julialang.org/t/custom-flux-layer-connect/36262/3 "2023-09-05T08:31:31Z")

</div>

I would just create a custom type containing all layers and define its forward pass. See the docs [Custom Layers · Flux](https://fluxml.ai/Flux.jl/stable/models/advanced/#Custom-Model-Example)

---

<div class="post-metadata">

### Author: ![TobiS](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TobiS](https://discourse.julialang.org/u/TobiS)
#### Post date: [September 6, 2023, 7:56am UTC](https://discourse.julialang.org/t/custom-flux-layer-connect/36262/4 "2023-09-06T07:56:19Z")

</div>

I did not find a solution and stopped back then. @CarloLucibello the solution sounds promising
