Tree-based neural networks in owl

Hi !
I am kind of new to owl, and I have a bit of a problem with neural networks :
Basically I am trying to implement a network that takes non-matricial data.

More specifically I am trying to code a neural network that takes trees as input (a variant of tbcnn)
The problem I am encountering is that, the input being binary trees, it does not always have the same structure
this is theoretically not a problem (since the differentiation is normally done on the parameters, but only on the optimization parameters), i tried to write the layers that operate on trees (the convolution layers) as Lambda nodes in owl.
But, if I got owl requires all input for a NN node to be Algodiff.t . (which my trees are not)
The solution I have found is to encode my binary trees as matrices (using a list of nodes ordered depth-first). It should work (i have not finished), but is not very elegant.
Do you know if there is a more elegant way ?

1 Like

Hi there! Will you be needing a lot of the neural network layers (e.g. conv nets, lstms etc.) in Owl?
If not, it might be easier to directly work with Algodiff, and write your own neural networks and differentiable loss functions. You can optimize your parameters using https://github.com/owlbarn/owl_opt
This might be a bit more verbose, but could also be more efficient.

2 Likes

Thanks for your answer. The problem is that I will need several neural network layers (some FC, but probably also LSTM).
Thank for the link to owl_opt though, I will look into it !