Skip to content

Instantly share code, notes, and snippets.

@stites
Last active July 25, 2018 15:48
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 stites/971c32d912a12293c49948acfecb650e to your computer and use it in GitHub Desktop.
Save stites/971c32d912a12293c49948acfecb650e to your computer and use it in GitHub Desktop.
optimization: False
debug-info: True
executable-stripping: False
package hasktorch-zoo
flags: +cuda
package hasktorch-indef
flags: +cuda
package hasktorch-core
flags: +cuda
name: hasktorch-zoo
version: 0.0.1.0
synopsis: Neural Architectures in hasktorch
description: Neural Architectures in hasktorch
homepage: https://github.com/hasktorch/hasktorch#readme
bug-reports: https://github.com/hasktorch/hasktorch/issues
license: BSD3
author: Sam Stites
category: Tensors, Machine Learning
build-type: Simple
cabal-version: >= 1.10
source-repository head
type: git
location: https://github.com/hasktorch/hasktorch
flag cuda
Description: build with cuda support
Default: False
library
hs-source-dirs: src
ghc-options: -Wall -fno-cse -Wno-missing-signatures
other-modules: Paths_hasktorch_zoo
default-extensions: RankNTypes, DataKinds, TypeOperators, TypeFamilies, CPP
default-language: Haskell2010
build-depends:
base >=4.7 && <5
, backprop
, dimensions
, hasktorch-core
, microlens-platform
, microlens-th
, singletons
, ghc-typelits-natnormalise
-- data loader dependencies
, directory
, filepath
, JuicyPixels
-- training iterator dependencies
, list-t
, mtl
, monad-loops
, time
, transformers
exposed-modules:
Torch.Models.LeNet
Torch.Models.Internal
Torch.Data.Loaders.Cifar10
Torch.Data.Metrics
-- Torch.Data.Runners.Cifar10
if flag(cuda)
cc-options: -DCUDA
module Torch.Models.LeNet where
data LeNet ch step = LeNet
{ _conv1 :: !(Conv2d ch 6 '(step,step))
, _conv2 :: !(Conv2d 6 16 '(step,step))
, _fc1 :: !(Linear (16*step*step) 120)
, _fc2 :: !(Linear 120 84)
, _fc3 :: !(Linear 84 10)
}
instance (KnownDim (16*step*step), KnownDim ch, KnownDim step) => Show (LeNet ch step) where
show (LeNet c1 c2 f1 f2 f3) = intercalate "\n"
#ifdef CUDA
[ "CudaLeNet {"
#else
[ "LeNet {"
#endif
, " conv1 :: " ++ show c1
, " conv2 :: " ++ show c2
, " fc1 :: " ++ show f1
, " fc2 :: " ++ show f2
, " fc3 :: " ++ show f3
, "}"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment