mlajtos / moniel

Interactive Notation for Computational Graphs
https://mlajtos.github.io/moniel/
MIT License
354 stars 27 forks source link

Automagically recognize Inputs and Outputs #11

Open mlajtos opened 7 years ago

mlajtos commented 7 years ago

Having a metanode like this:

{ [In,Parameter] -> Transformation -> Out}

One can easily omit explicit Input and Output declaration since constructed graph implicitly has this information:

{ [in,Parameter] -> Transformation -> out}

By this rule, every source node without explicit Input type is an Input. And vice versa, every sink node without explicit Output type is an Output.

What to do when node is source AND sink at the same time?

mlajtos commented 6 years ago
  1. Ø (empty atom =^? identity)
  2. a (a:[I,O], pass by, identity) 1.5 a b (||, double pass by, double identity)
  3. a -> b (a:I, b:O, identity)
  4. a b->c (c:O, b:I, a:[I,O], (..hmm, most is identity))
  5. a -> b -> c (yay, finally!)
mlajtos commented 6 years ago

So in the end, this:

{ [In,Parameter] -> Transformation -> Out}

becomes:

{ [in, Parameter] -> Transformation }

("In" becomes type-less node and "Out" becomes literaly type-less :D, therefore "Transformation" becomes implicitly output/sink node)

mlajtos commented 6 years ago

therefore "Transformation" becomes implicitly output/sink node

There are two way out of this:

  1. Use I/O (source/sink) flag for every node
  2. Implicitly insert Input/Output nodes where appropriate

Both are equally weird solutions, so it doesn't matter which to choose.

mlajtos commented 3 months ago

Related

Snímka obrazovky 2024-05-26 o 22 01 51