zenna / Arrows.jl

14 stars 2 forks source link

Fix id_loss #47

Closed zenna closed 7 years ago

zenna commented 7 years ago

Id_loss breaks (I believe) because the inverse arrow has domain_error outports so the correspondance between the out_ports of inv and the in_ports of fwd are broken. I do that correspondence in a pretty naive way (assume they are aligned in number). I think there are three levels of fixes

  1. ignore the doman_loss outputs when doing the correspondence, and make sure to link them to parent
  2. Do the correspondence by name instead of number. We'd need to ensure that invert preserves names, and that #35
  3. Figure out more semantic/explicit way to represent correspondences, this is in part what #17 attempts to do.

We should do 1. now and revisit the rest later

jburroni commented 7 years ago

id_loss! does two thing: The first thing is to wire the output of the inv with the input of the fwd. For this step the ϵ ports are ignored. After that, it should wire the ϵ ports from the inv to the CompArrow, as we want the values to be push out of the Arrow.

I think it's worth to proceed with #17. Probably the function invert! is the function create this relations. In particular, the call toinvert_all_ports.