Skip to content

Commit

Permalink
clean up stale code
Browse files Browse the repository at this point in the history
  • Loading branch information
wavewave committed May 31, 2022
1 parent 4aee818 commit 8815aeb
Showing 1 changed file with 4 additions and 49 deletions.
53 changes: 4 additions & 49 deletions examples/grad-descent/F.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}

module F where

{- ( Input (..),
module F
( Input (..),
Output (..),
Param (..),
XY (..),
rosenbrock,
dRosenbrock,
wrap_rosenbrockF,
wrap_dRosenbrockF,
) -}
)
where

import qualified Categorifier.C.CExpr.Cat as C
import Categorifier.C.CExpr.Cat.TargetOb (TargetOb, TargetObTC1)
Expand Down Expand Up @@ -130,48 +130,3 @@ dRosenbrockF (Input (Param a b) (XY x y)) =
$(Categorify.separately 'rosenbrockF [t|C.Cat|] [pure [t|C|]])

$(Categorify.separately 'dRosenbrockF [t|C.Cat|] [pure [t|C|]])

{-
let rosenbrock' :: forall s. Reifies s Tape => [Reverse s a] -> Reverse s a
rosenbrock' [x', y'] =
let a' = Lift a
b' = Lift b
in rosenbrock (a', b') (x', y')
[dfdx, dfdy] = grad rosenbrock' [x, y]
in (dfdx, dfdy)
-}
{-
let rosenbrock' :: forall s. Reifies s Tape => [Reverse s (f Double)] -> Reverse s (f Double)
rosenbrock' [x', y'] =
let a' = realToFrac a
b' = realToFrac b
in rosenbrock (a', b') (x', y')
[dfdx, dfdy] = grad rosenbrock' [x, y]
in XY dfdx dfdy
-}
-- dummy_ :: XY C -> XY C
-- dummy_ xy = kFunctionCall (Proxy @C) "dummy" dummy xy

{-
dRosenbrockF {- Param -> -} ::
XY -> XY
dRosenbrockF (XY x y) =
let p = Param 1 10
in -- x' = gg x
-- kFunctionCall (Proxy @C) "dRosenbrock_c" dummy (XY x y)
-- dummy 2 (XY x y)
-- kFunctionCall (Proxy @C) "dRosenbrock_c" dRosenbrock_ (XY x y)
-}

{- dummydRosenbrock_ p -}

-- $(Categorify.function 'rosenbrockF [t|C.Cat|] [])

-- $(Categorify.function 'dRosenbrockF [t|C.Cat|] [])

-- $(Categorify.function 'dummy_ [t|C.Cat|] [])

-- $(Categorify.separately 'dRosenbrock_ [t|C.Cat|] [])

-- wrap_dRosenbrockF = id

0 comments on commit 8815aeb

Please sign in to comment.