Skip to content

Instantly share code, notes, and snippets.

@vermorel
Last active August 3, 2017 06:48
Show Gist options
  • Save vermorel/df832ccba3e1d40e0a79b24ad199bcf3 to your computer and use it in GitHub Desktop.
Save vermorel/df832ccba3e1d40e0a79b24ad199bcf3 to your computer and use it in GitHub Desktop.
Handy bits of BrainScript code
# A constant 1D tensor that contains an enumeration 0 .. (count - 1).
Range(count) = Splice( array [0..(count-1)] ( i => Constant{i} ) )
# residual units
ResNet(InnerDim, OuterDim, INNODE) = {
L1 = DenseLayer {InnerDim, activation = ReLU, init = "gaussian"}( INNODE )
L2 = DenseLayer {OuterDim, activation = Pass, init = "gaussian"}( L1 )
ResUnit = ReLU(Plus(INNODE, L2))
}.ResUnit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment