CS564 - Brain Theory and Artificial Intelligence, USC, Fall 2001. 1 Neural Simulation Language NSL.

Slides:



Advertisements
Similar presentations
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Advertisements

Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
CS 450 Module R4. R4 Overview Due on March 11 th along with R3. R4 is a small yet critical part of the MPX system. In this module, you will add the functionality.
 2005 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Object Oriented Programming in Java George Mason University Fall 2011
 Statistics package  Graphics package  Programming language  Can be used to share/reproduce analyses  Many new packages being created - can be downloaded.
Contact info Controlling Mobile Robots with Distributed Neuro-Biological Systems Sebastian Gutierrez-Nolasco (UCI) Nalini Venkatasubramanian.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Fall 2007CS 2251 Programming Tools Eclipse JUnit Testing make and ant.
GNE: Global NEWS Modeling Environment What it is / what it’s not How it works Components, samples Installation NEWS 2 Implementation Emilio MayorgaMay.
Asynchronous Solution Appendix Eleven. Training Manual Asynchronous Solution August 26, 2005 Inventory # A11-2 Chapter Overview In this chapter,
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Design Verification Design Profiler Course 8. All materials updated on: September 30, Design Profiler Design Profiler is a tool integrated within.
Linux Operations and Administration
Digital Image Processing Lecture3: Introduction to MATLAB.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Comp 248 Introduction to Programming Chapter 4 - Defining Classes Part A Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
CS110/CS119 Introduction to Computing (Java)
Servlets Environment Setup. Agenda:  Setting up Java Development Kit  Setting up Web Server: Tomcat  Setting up CLASSPATH.
Introduction to Shell Script Programming
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Modularity Lecture 4 Course Name: High Level Programming Language Year : 2010.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
Linux Operations and Administration
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
1 USC Brain Project: Lab Resources and Modeling Tools James Bonaiuto.

Pointers OVERVIEW.
Introduction to CS520/CS596_026 Lecture Two Gordon Tian Fall 2015.
1 CS210 Intermediate Computing with Data Structures (Java) Saaid Baraty S-3-90.
Java™ How to Program, 10/e © Copyright by Pearson Education, Inc. All Rights Reserved.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Michael Arbib CS564 - Brain Theory and Artificial Intelligence, USC, Fall Lecture 19. Systems Concepts 1 Michael Arbib: CS564 - Brain Theory and.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
Static. 2 Objectives Introduce static keyword –examine syntax –describe common uses.
Laurent Itti: CS564 - Brain Theory and Artificial Intelligence. Saccades 1 1 L. Itti: CS564 - Brain Theory and Artificial Intelligence University of Southern.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
Michael Arbib CS564 - Brain Theory and Artificial Intelligence, USC, Fall Lecture 16. NSLJ Backprop 1 Michael Arbib: CS564 - Brain Theory and Artificial.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Chapter 2: Data and Expressions. Variable Declaration In Java when you declare a variable, you must also declare the type of information it will hold.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Node.js Modules Header Mastering Node.js, Part 2 Eric W. Greene
CS210 Intermediate Computing with Data Structures (Java)
Development Environment
& BuildingTcl & BuildingTclViewer Getting Started Guide
Chapter No. : 1 Introduction to Java.
Chapter 3: Using Methods, Classes, and Objects
WORKSHOP 3 GSE IMPORT.
Chapter 3 Introduction to Classes, Objects Methods and Strings
Chapter 3 Introduction to Classes, Objects Methods and Strings
Instructions to get MAX PLUS running
Getting Started With Solr
Object Oriented Programming in java
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Zorah Fung University of Washington, Winter 2016
Presentation transcript:

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Neural Simulation Language NSL

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Overview  Introduction  NSLM  Example (Max Selector)  NSLS  Downloading and installing NSL

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Introduction NSL is a platform for  Building neural architectures (modeling)  NSLM  NSLJ & NSLC  Executing them (simulation).  NSLS NSL provides tools for modeling complex neural systems - especially (but not only) when the neurons are modeled as leaky integrator neurons.

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Methodology The general methodology for making a complex neural model of brain function is to combine different modules corresponding to different brain regions. To model a particular brain region, we divide it anatomically or physiologically into different neural arrays. Each brain region is then modeled as a set of neuron arrays, where each neuron is described for example by the leaky integrator, a single-compartment model of membrane potential and firing rate.

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Levels of abstraction A complete model in NSL requires the following components: a set of modules defining the entire model neurons comprised in each neural module neural interconnections neural dynamics numerical methods to solve the differential equations.

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Example of modules

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Leaky integrator

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Simulation

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Simulation Methods initSys initModule makeConn … (simulation steps) endModule endSys

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Simulation Methods initTrainEpoch initTrain simTrain endTrain endTrainEpoch initRunEpoch initRun simRun endRun endRunEpoch train run trainAndRunAll doTrainEpochTim es doRunEpochTime s

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Model Structures Model  Highest level Modules  NeuralNetworks InModules OutModules  Graphic Interfaces MotorModules  Robotics NslClass  Libraries  New Canvases  New NSLS Commands

CS564 - Brain Theory and Artificial Intelligence, USC, Fall NSLM Types Primitive types  int  float  double  boolean  char NslData types (0, 1, 2, 3, 4)  NslInt  NslFloat  NslDouble  NslBoolean  NslString (0) Could be public, private or protected. NslPort types (0, 1, 2, 3, 4)  NslDinInt  NslDinFloat  NslDinDouble  NslDinBoolean  NslDinString (0)  NslDoutInt  NslDoutFloat  NslDoutDouble  NslDoutBoolean  NslDoutString (0) Ports must be public

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Max Selector Model The details of this model can be found in section 4.4 of TMB2. The model uses competition mechanisms to obtain, in many cases, a single winner in the network where the input signal with the greatest strength is propagated along to the output of the network.

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Max Selector Model (2)

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Max Selector Model (3) MaxSelectorModel MaxSelector Stimulus Output ULayer VLayer

CS564 - Brain Theory and Artificial Intelligence, USC, Fall MaxSelectorModel nslImport nslAllImports; nslImport MaxSelectorStimulus; nslImport MaxSelector; nslImport MaxSelectorOutput; nslModel MaxSelectorModel() { nslConst int size = 10; private MaxSelectorStimulus stimulus(size); private MaxSelector maxselector(size); private MaxSelectorOutput output(size); public void initSys() { system.setRunEndTime(10.0); system.nslSetRunDelta(0.1); } public void makeConn() { nslConnect(stimulus.s_out, maxselector.in); nslConnect(stimulus.s_out, output.s_out); nslConnect(maxselector.out, output.uf); }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall MaxSelectorStimulus nslImport nslAllImports; nslModule MaxSelectorStimulus(int size) { public NslDoutDouble1 s_out(size); public void initRun() { s_out=0; s_out[1]=0.5; s_out[3]=1.0; }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall MaxSelectorOutput nslImport nslAllImports; nslOutModule MaxSelectorOutput(int size) { public NslDinDouble1 s_out(size); public NslDinDouble1 uf(size); private NslDouble1 up(size); private boolean worked= false; public void initModule() { up.nslSetAccess('W'); nslAddAreaCanvas(s_out,0,1); nslAddTemporalCanvas(up,-2.5,2.5); nslAddAreaCanvas(uf,0,1); } public void simRun() { worked=nslSetValue(up,"maxSelectorModel.maxselector.u1.up"); }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall MaxSelector nslImport nslAllImports; nslImport Ulayer; nslImport Vlayer; nslModule MaxSelector(int size) { public NslDinDouble1 in(size); public NslDoutDouble1 out(size); private Ulayer u1(size); private Vlayer v1(); public void makeConn() { nslRelabel(this.in, u1.s_in); nslConnect(u1.uf, v1.u_in); nslConnect(v1.vf, u1.v_in); nslRelabel(u1.uf, this.out); }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall ULayer nslImport nslAllImports; nslModule Ulayer(int size) { //inports public NslDinDouble1 s_in(); public NslDinDouble0 v_in(); //outports public NslDoutDouble1 uf(size); //variables private NslDouble1 up(size); private NslDouble0 w1(); private NslDouble0 w2(); private NslDouble0 h1(); private NslDouble0 k(); private double tau; …

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Ulayer(2) public void initRun(){ uf = 0; up = 0; tau = 1.0; w1= 1.0; w2= 1.0; h1= 0.1; k= 0.1; } public void simRun(){ //compute : up=up+((timestep/tu)*du/dt) up = nslDiff(up, tau, -up + w1*uf-w2*v_in - h1 + s_in); uf = nslStep(up,k.get(),0,1.0); }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall VLayer nslImport nslAllImports; nslModule Vlayer() { // ports public NslDinDouble1 u_in(); // output port public NslDoutDouble0 vf(); // variables private NslDouble0 vp(); // neuron potential private NslDouble0 h2(); private double tau; // time constant …

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Vlayer (2) public void initRun() { vf=0; vp=0; tau=1.0; h2 = 0.5; } public void simRun() { // vp=vp+((timestep/tv)*dv/dt) vp = nslDiff(vp, tau, -vp + nslSum(u_in) -h2); vf = nslRamp(vp); }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Compilation One model/module per file The file extension must be.mod We recommend to clean the model directory before compiling with the nslclean command To compile the model you just have to execute the following command: nslc modelName Where modelName is the Name of the file that contains the model structure. For this example we should write: nslc MaxSelectorModel Note that we didn’t write the file extension at the end of the name. Mod FileNlx FileJava File Class File

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Execution To simulate your model you have to use the nsl command. For this example you should write: nsl MaxSelectorModel Two running modes  Text (-nodisplay)  Graphic interface (default) To redirect the standard output (-stdout console) To redirect the standard error (-stderr console)

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Interface

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Interface (2)

CS564 - Brain Theory and Artificial Intelligence, USC, Fall NSLS To avoid re-compiling every time you modify your model parameters we provide the NSL script language known as NSLS which also provides a dynamic user control environment. NSLS provides the following functionality:  NSL model parameter assignment  NSL input specification  NSL simulation control  NSL file control  NSL graphics control NSLS is an extension of the well know TCL scripting language, thus providing NSL and TCL functionality.

CS564 - Brain Theory and Artificial Intelligence, USC, Fall NSLS (2) NSL command syntax: nsl subcommand [options] Important NSL commands:  nsl source fileName  (i.e. nsl source hopfield.nsls)  nsl set variable value  (i.e. nsl set maxSelectorModel.stimulus.s_out { })  nsl get variable  (i.e. nsl get maxSelectorModel.stimulus.s_out)  nsl run  nsl train  …  nsl exit

CS564 - Brain Theory and Artificial Intelligence, USC, Fall NSLS example # # Hopfield Network # set A {} set B {} set C {} set D {} proc memorize { x } { puts "Memorizing $x" nsl set hopfield.inModule.input $x nsl train } proc test { x d } { nsl set hopfield.dis $d nsl set hopfield.inModule.input $x nsl run }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall NSLS example (2) proc initData {} { global A B C D set A { { } { } { } { } } set B { { } { } { } { } } … }

CS564 - Brain Theory and Artificial Intelligence, USC, Fall NSLS example (3) proc trainNetwork {} { global A B C D memorize $A memorize $B memorize $C memorize $D } proc NslMain {} { global A B C D puts "Initializing" initData puts "Training" trainNetwork puts "Testing" for { set i 10 } { $i<20 } { incr i } { puts "Testing with distortion $i" test $A $i } nsl set hopfield.dis 0 } NslMain

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Downloading NSL First, you will need to install the latest Java SDK; get it directly from Sun at Once this is setup and working, download the entire NSL tree from Extract the archive (Winzip or Pkzip). Edit the file "NSL3_0_n\resume.bat" such that it matches your environment (you will have to specify the path where you installed Java, where you installed NSL, etc). Execute the resume batch file before beginning a NSL session.

CS564 - Brain Theory and Artificial Intelligence, USC, Fall Downloading NSL off echo Initializing NSL environment variables set NSLJ_ROOT=C:\salvador\NSL3_0_n set JAVA_HOME=C:\jdk1.3 set NSL_OS=windows echo Updating path and classpath set PATH=%JAVA_HOME%\bin;%NSLJ_ROOT%;%PATH% set CLASSPATH=%NSLJ_ROOT%;.;%NSLJ_ROOT%\nslj\src\main; %NSLJ_ROOT%\nslj\src\nsls\jacl; on

CS564 - Brain Theory and Artificial Intelligence, USC, Fall References A Weitzenfeld, MA Arbib and A Alexander, 2002, NSL Neural Simulation Language, MIT Press (in press) An old version is at: For any NSL related questions and bug reports, please send me an at