[ANN-RFC] TopoChains.jl v0.1 - flexibly define multi-input multi-output models

Pleased to announce TopoChains.jl to the community. TopoChains.jl extends on the flexibility of Flux’s Chain by introducing TopoChain, which allows you to explicitly declare the structure of the compositions of functions that make up a model (and builds directly on the work originally done for the Stacks submodule in Transformers.jl). The goal is to make it simpler and more accessible to write complex multi-input multi-output models in the Julia machine learning ecosystem.

For instance, the following model

can be written concisely as

topo = @functopo x => a:x => b:(a, b) => c => o

model = TopoChain(topo,
            Dense(32, 64),
            Dense(32, 64),
            (x, y) -> x .* y, 

I’d greatly appreciate feedback on both the package itself, as well as the quality of the documentation (this is my first time creating a Julia package, and I’d be humbled to know more about the norms of package writing in Julia).

The package is currently being added to the Registry, but you can get an early preview by directly adding it from GitHub. I wanted to get started on obtaining feedback during that time, and I’ll also update this post once the merge into the Registry is completed.


TopoChains.jl is now added to the registry, and you can use it today with add TopoChains. Feedback is always welcome!


I posted the above question, and I was wondering if TopoChains can be used to solve my issue of multiple features in a sequence? If so, can you please demonstrate.

It is a nice package. However, I suggest you to put in the documentation to define the same model twice: the more typical, and/or using the TopoChains to make easier the comparison. Also, the DSL must be defined clearly, I have problems in understand the “:” notation used in @functopo. I think it should explained from the beginning using several examples.