Unformatted text preview:

Synapse Language Reference Manual Jonathan Williford jw2389 columbia edu http synapse lang googlecode com Contents 1 Introduction 2 2 Document Conventions 2 3 Lexical Conventions 3 1 Comments 3 2 Identifiers 3 3 Keywords 3 4 Constants 3 4 1 Integer Constants 3 4 2 Float Constants 3 4 3 Built in Constants 3 5 Program Parameters 2 2 2 3 3 3 3 3 3 4 Program 4 1 Module Definition 4 2 Module Declaration 4 3 Function Definitions 4 3 1 Activation Function Definitions 4 3 2 Kernel Function Definition 4 4 Inter Module Synaptic Connections 3 4 5 5 5 5 6 5 Expressions 5 1 Primary expressions 5 2 Convolution operator 5 2 1 expression kernel call 5 3 Unary operator 5 3 1 expression 5 4 Exponential operator 5 4 1 expression 1 expression 2 5 5 Multiplicative operators 5 5 1 expression 1 expression 2 5 5 2 expression 1 expression 2 5 6 Additive operators 5 6 1 expression 1 expression 2 5 6 2 expression 1 expression 2 6 6 7 7 7 7 8 8 8 8 8 8 8 8 1 6 Function Calls 6 1 Built in functions 6 1 1 sin 6 1 2 cos 6 1 3 exp 6 2 User defined functions 8 8 8 8 8 9 7 Macros 7 1 size macro 7 2 for macro 9 9 9 8 Scope 9 9 Parallelism 10 10 Future Additions 10 11 Examples 11 1 Image Sharpening 11 2 Image Mirror 10 10 11 1 Introduction Before mathematical models were used in neuroscience models have mainly been limited to imprecise word models Such word models that have sounded reasonable in the past have turned out to be inconsistent and unworkable when trying to convert to a mathematical model Abbott Simulation enables precise models to be tested on large interconnected networks The proposed language Synapse is a language specifically for modeling and simulating neural networks While every neuron in the brain executes in parallel most languages are written for architectures that execute sequential Even as parallel computing becomes more important parallel support is usually added as an afterthought For example CUDA relies on extending C and C so that it can take advantage of nVidia s graphic cards and OpenMP adds C preprocessor commands to enable among other things parallel for loops Synapse is a language that being created for parallel execution from the ground up The source code and documentation including the LaTeX source for PDFs may be downloaded from 2 Document Conventions Literals are denoted with monospace Syntatic categories are denoted with italics and are all lowercase Identifiers integers and floats are represented by Id Int and Float respectively Optional items are indicated with opt in subscripts following the item ex optional itemopt Sometimes the syntatic categories are enumerated in the suffix ex item 1 for ease of reference Section numbers to the right of the productions indicate the location of syntatic categories not defined in the same subsection 3 3 1 Lexical Conventions Comments Comments begin with the characters and continue until 3 2 Identifiers Identifiers consist of letters digits and underscores The first character must be a letter Identifiers are case sensitive 2 3 3 Keywords The following identifiers are reserved keywords and may not be used for any other purpose module size for begin end kernel pi e sin cos exp pragma input 3 4 Constants There are two types of constants int constants and float constants 3 4 1 Integer Constants An int consists of one or more digits 3 4 2 Float Constants A float consists of a decimal point and at least one digit The precision of the float is compiler dependent and may even be implemented as an integer using scaling An int can be implicitly casted as a float but not vice versa 3 4 3 Built in Constants e and pi are built in constants which are approximately 2 71828 and 3 14159 respectively The accuracy depends on the precision of float used by the compiler 3 5 Program Parameters The input output sources of the program are specified by 1 2 etc For command line applications 1 corresponds to the first parameter 2 the second etc How they are used will determine whether they are input or output They may not be both Every input must be declared with its dimension input decl input Param dimensions 4 4 2 Program A program consists of module definitions module declarations kernel function definitions activation function definitions and synaptic connections 3 program nothing input decl program module def program module decl program activation def program kernel def program synap connection program 4 1 3 5 4 1 4 2 4 3 1 4 3 2 4 4 Module Definition Neurons can only be defined in modules Multiple instances of a module can be used with module declarations section 4 2 There are three exclusive types of neurons in a module input neurons output neurons and inner neurons Input neurons receive external signals output neurons send external signals and inner neurons are encapsulated in the module module def module Id neurons 1 neurons 2 module body Id is the name of the module neurons 1 and neurons 2 are the list of input and output neurons respectively neurons Id Id neurons The inner and output neurons are defined with an activation expression inside of the module using neurondef The activation expression of an input neuron is defined by synaptic connections outside of the module using synap connection All modules are globally defined however instances of a module can be declared inside another Recursive instantions are not allowed module body nothing neuron def module body synap connection module body module decl module body Within a module Between modules 4 4 4 2 neuron def Id dimensionsopt Id dimensionsopt 7 2 expression expression for for list The variable iterators can only be used in expression dimensions is used to specify the size of the array of neurons and must be equal in size of the expression that is being iterated over Modules may be used directly modulename1 input modulename2 output or may be instantiated modulename1 mods 2 mods 1 input neuron mods 2 output neuron 4 4 2 Module Declaration Once a module has been defined multiple instances can then be declared module decl Id 1 Id 2 dimensionsopt where Id 2 is a new instance of the module Id 1 module module1 x y y act 5 x module module2 input 100 output module1 mod 100 mod i x input i for i 1 end output act mod i y gauss dimensions const int list const int list const int expr const int expr const int list 5 1 Modules may also contain instantiations of other modules 4 3 Function Definitions There are two types of functions allowed in Synapse activation functions and kernel functions Activation functions


View Full Document

Columbia COMS W4115 - Synapse

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view Synapse and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Synapse and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?