Skip to content

Instantly share code, notes, and snippets.

@rossng
Last active December 3, 2017 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rossng/41a75338e7067510874ffae37b015608 to your computer and use it in GitHub Desktop.
Save rossng/41a75338e7067510874ffae37b015608 to your computer and use it in GitHub Desktop.
interface Layer (layer : Vect ir Nat -> Vect or Nat -> Type) where
runLayer : Tensor ir i Double
-> layer i o
-> Tensor or o Double
data FullyConnected : (ir : Nat) -> (or : Nat) -> Vect ir Nat -> Vect or Nat -> Type where
MkFullyConnected : (ir = 1)
-> (or = 1)
-> (biases : Tensor 1 o Double)
-> (weights : Tensor 2 ((head o) :: i) Double)
-> FullyConnected 1 1 i o
Layer (FullyConnected 1 1) where
runLayer input (MkFullyConnected ir or biases weights) = biases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment