-- | find a node in f that is the same DSPNode as n
--   if no such node is found, give back n
findSameNode :: Filter -> DSPNodeL -> DSPNodeL
findSameNode f n = case catMaybes $ foldr (\n1 ns -> (if sameConstructor (nodeContent n1) (nodeContent n) then Just n1 else Nothing):ns) [] f of
  [] -> n
  xs -> head xs

--implements feature scaling so during GD our thetas are -1<t<1
--we only scale them back to the appropriate values when we need to apply theatas in a filter
findSameNode :: Filter -> DSPNodeL -> DSPNodeL
findSameNode f n = case catMaybes $ foldr (\n1 ns -> (if sameConstructor (nodeContent n1) (nodeContent n) then Just n1 else Nothing):ns) [] f of
  [] -> n
  xs -> head xs

--implements feature scaling so during GD our thetas are -1<t<1
--we only scale them back to the appropriate values when we need to apply theatas in a filter
findSameNode f n = case catMaybes $ foldr (\n1 ns -> (if sameConstructor (nodeContent n1) (nodeContent n) then Just n1 else Nothing):ns) [] f of
  [] -> n
  xs -> head xs

--implements feature scaling so during GD our thetas are -1<t<1
--we only scale them back to the appropriate values when we need to apply theatas in a filter