www.archive-net-2013.com » NET » P » PAKL

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

    Archived pages: 32 . Archive date: 2013-12.

  • Title: Patryk Laurent Homepage
    Descriptive info: .. Home.. Research.. Software.. About.. Patryk Laurent.. I am a neuroscientist and neural network modeler at Brain Corporation in San Diego, California.. Using computer simulations, I study how networks of neurons learn to control themselves and generate thought, decisions, memory and movement.. Publications and Presentations.. For a complete list, see my.. CV here.. Publication:.. Cole M.. W.. ,.. Laurent P.. , Stocco A.. (2013) Rapid instructed task learning: A new window into the human brain's unique capacity for flexible cognitive control.. Cognitive, Affective, Behavioral Neuroscience.. (journal link).. Laurent, P.. A.. (2012) A Neural Mechanism for Reward Discounting: Insights from Modeling Hippocampal-Striatal Interactions.. Cognitive Computation.. (.. journal link.. ) (.. my draft, free.. ).. Latest News.. Check.. my blog.. Software:.. EchoCancel.. - fMRI scanner noise cancellation.. Software:.. Arcly - an R client for iOS.. (2012).. Check back here soon for some interesting demos and download links!.. Here is some software I've developed during my research.. You are free to use any of this source code in your work as long as you acknowledge me.. I hope to get around to selecting a more specific open source license soon.. Computational Modeling.. NNQL.. My project to develop a simple but powerful neural network simulation language inspired by SQL.. NNQL minimizes programming time, maximizes clarity of model descriptions, and improves communication between modelers and non-modelers.. Adaptive Reading Agent Simulator..  ...   Noise Echo Cancellation.. If you need to hear your participant in real time during your fMRI experiment, this ChucK script allows you to cancel out the scanner noise during EPI data acquisition.. Patryk was born in New York and grew up in Africa and in the Caribbean.. When Patryk was 6 years old, he began programming his Commodore 64 to ask questions and interpret their answers.. A little over a decade later, while reading a book called "Computers and Human Language Processing" on a plane, he stumbled into a neatly hidden chapter on.. neural networks.. This initiated a major paradigm shift in his thinking.. Patryk began studying the Cognitive Sciences and Neuroscience at the University of Virginia, and accepted an undergraduate research position in Dr.. William Levy's Laboratory of Systems Neurodynamics.. After resharpening his software skills in industry for a few years, he resumed his studies and earned a Ph.. D in Neuroscience from the University of Pittsburgh.. Dr.. Laurent then accepted a postdoctoral research position at the Johns Hopkins University where he carried out a several research projects studying how reward influences attention in humans.. At the present time, he is ecstatic to be doing cutting-edge neural network modeling research as a scientist Brain Corporation.. 2003-2009.. 2009-2012.. 2012-now.. 1997-2001.. 1998-2001.. 2002-2003.. Patryk Laurent, Ph.. D Scientist, Brain Corporation (.. web.. ) San Diego, CA 92130..

    Original link path: /
    Open archive

  • Title: The Bottom Half | Code snippets and neuronal bursts
    Descriptive info: The Bottom Half.. Code snippets and neuronal bursts.. Search.. Main menu.. Skip to primary content.. Skip to secondary content.. Applescript terminal monitoring.. Posted on.. Monday.. by.. patryk.. The following script monitors the contents of your terminal window, and lets you know if it stops changing.. -- Monitors terminal window contents.. -- If contents do not change, assumes simulation is complete.. set voice_name to "Serena" say "[[emph +]]I am monitoring the [[emph +]]simulation.. I will let you know when it is completed.. " speaking rate 200 using voice_name tell application "Terminal" activate set old_contents to contents of window 1 as text end tell repeat delay 5 tell application "Terminal" activate set current_contents to contents of window 1 as text end tell if current_contents = old_contents then exit repeat else say "The simulation is still [[rate 210]]running" speaking rate 200 using voice_name end if set old_contents to current_contents end repeat say "Simulation [[rate 130]]complete.. " speaking rate 200 using voice_name.. Posted in.. Uncategorized.. Reading keys.. Wednesday.. Here is how to read a key from the keyboard in Scala:.. object Key extends App { val con = new tools.. jline.. console.. ConsoleReader() println(con.. readVirtualKey()) }.. and in Python:.. def getch(): import sys, tty, termios fd = sys.. stdin.. fileno() old = termios.. tcgetattr(fd) try: tty.. setraw(fd) return sys.. read(1) finally: termios.. tcsetattr(fd, termios.. TCSADRAIN, old) if __name__ == '__main__': print "got ",getch().. Representing a case class as a JSON String.. Sunday.. The following shows how to serialize a case class into a JSON string.. This is useful if you would like to have a compatible textual representation of a simple scala case class object for example, here, a Person(name:String, age:Int, city:String).. object cc extends App { case class Person(name:String, age:Int, city:String) val p = new Person("Patryk", 34, "Baltimore") println(mapToJson(caseClassToMap(p))) def caseClassToMap(cc: AnyRef) = (Map[String, Any]() /: cc.. getClass.. getDeclaredFields) {(a, f) => f.. setAccessible(true) a + (f.. getName -> f.. get(cc)) } def mapToJson(x:Map[String,Any]):String= { ("{" + (x collect { case (key,value) => { "\"" + key + "\" : \"" + value + "\"," } }).. mkString + "}").. replace(",}", "}") } }.. Counting instances of words in text.. object wc extends App { val text = "This is some text with some repeated repeated words words words" println(countsOf(text)) def countsOf(text:String):Map[String,Int]= { var result:Map[String,Int] = Map() (text split " ") foreach (thisWord => { val oldCount = if (result contains thisWord) result(thisWord) else 0; result += (thisWord -> (1 + oldCount)) }) result } }.. A minimal web server in Scala.. Friday.. Here is a minimalist web server in scala.. import java.. net.. _ import java.. io.. _ import scala.. util.. control.. Breaks.. _ object Web2 extends App { val BLANK_LINE_AT_END_OF_REQUEST = 1 val webServer = new Thread("Web Server") { def response(text: String, code: String = "200 OK") = """HTTP/1.. 0 """ + code + """ Content-Type: text/html Content-Length: """ + text.. length + """ """ + text override def run { for(port.. return } } } } webServer.. start(); }.. Plotting in R from Scala.. It s really useful to be able to make high-quality plots from code.. Here, I m plotting in R from Scala.. To use this, you must get REngine.. jar and RserveEngine.. jar from the.. Rserve website.. and place them on your classpath..  ...   List(a big apple, a big chair) The big items were: List(apple, chair).. Scala.. Reading CSV data into associative arrays in Scala.. Tuesday.. Many data files that we want to access are in CSV format.. In analysis programs, it s great to be able to access each row as an associative array.. For example, suppose your CSV file looked like this:.. name,age,RT Mercury,25,220 Jupiter,33,230 Apollo,52,260.. We would like a nice API to pull out response times (RT) from a column named RT.. For example, it would be great to write code like:.. val rows = readCSVFile("mydata.. txt") rows foreach (row = { println(row("RT")) }).. The following code defines an associative array and the corresponding readCSVFile function that you can use in this manner:.. type AssociativeArray = Map[String,String] def readCSVFile(filename:String):List[AssociativeArray]= { val csv = (io.. Source.. fromFile(filename) getLines() map (line = line.. split(",") toList) toList) val headers = csv head val data = csv tail data map (row = (headers zip row).. toMap) }.. Code.. ,.. UsefulTools.. Learning from Reinforcement in Scala.. Here is some minimal code that implements Reinforcement Learning (dynamic programming using Value Iteration) for a grid world problem.. Including comments, it s less than 100 lines of code.. The code could be modified to use temporal-difference learning with a few small changes.. // ----------------------------------------------------------- // Minimal Reinforcement Learning in Scala // ----------------------------------------------------------- // Problem: GridWorld with a goal terminal state // Algorithm: Value Iteration // Storage: Lookup table // ----------------------------------------------------------- // Patryk Laurent (http://pakl.. net) // ----------------------------------------------------------- object SimpleRL extends App { case class State(x:Int, y:Int) case class Action(deltaX:Int, deltaY:Int) val maxX = 10; val maxY = 10; val world = for (i.. (eachLocation, initialValue)) : _*); var newvf:Map[State,Double] = Map(world map (eachLocation => (eachLocation, initialValue)) : _*); def rf(arrivedAt:State) = { -1.. 0 } // for each move def nextState(s:State,a:Action) = { new State(s.. x+a.. deltaX, s.. y+a.. deltaY) } def outcomeFor(s:State,a:Action) = { rf(nextState(s,a)) + discountFactor * vf(nextState(s,a)) } def isTerminal(s:State):Boolean = { if (s == State(0,0)) return true; else return false; } def isAllowed(s:State,a:Action):Boolean= { // Disallow movements outside the grid val next = nextState(s,a); if (next.. x.. maxX) return false; if (next.. y.. maxY) return false; return true; } // ----------------------------------------------------------- // Perform Value iteration from each non-terminal state // ----------------------------------------------------------- (1 to 10000).. seq.. foreach(trial => { (world filter (s => !isTerminal(s))) foreach (s => { val possible = possibleActions filter (a => isAllowed(s,a)); val bestAction = possible.. maxBy(outcomeFor(s,_)); val delta = outcomeFor(s, bestAction) - vf(s); newvf += s -> (vf(s)+epsilon*delta); }) val temp = vf; vf = newvf; newvf = temp; // Swap }) // ----------------------------------------------------------- // Display value function // ----------------------------------------------------------- println("Learned value function (values for for each (x,y) in the grid):"); for (x.. !isTerminal(s)); nonTerminals foreach (s => { val allowedActions = possibleActions filter (a => isAllowed(s,a)); val bestAction = allowedActions.. maxBy(outcomeFor(s,_)); result += (s -> bestAction) }) result } val optimalPolicy = policy(world.. toList, vf, possibleActions.. toList); println("Policy Demo: 'From 5,5 the best action is " + optimalPolicy.. get(new State(5,5)).. get+"'"); }.. Welcome to the Bottom Half.. Hello there.. This blog is going to be a place where I will jot down small pieces of hopefully useful information for later.. Recent Posts.. Categories.. Category Cloud.. Meta.. Log in.. Entries.. RSS.. Comments.. WordPress.. org.. Proudly powered by WordPress..

    Original link path: /blog/
    Open archive

  • Title: EchoCancel - EPI Echo Cancelation
    Descriptive info: EchoCancel - EPI Noise Echo Cancellation.. pakl.. ).. This program uses scanner noise from the previous TR to cancel out sound during the next TR, allowing you to hear what a participant says.. Use it live:.. Use this program during fMRI studies so you can hear your participant in real time.. Use it off-line:.. You can also use this program after the fMRI scan to process your recordings from the scanner, leaving you with a pretty clean copy.. Notes:.. The precise repetition time (TR) may change slightly from day to day.. You may need to calibrate the timing of  ...   works when participants are responding during a single TR.. If they respond during two TRs in a row, the response from the first TR will interfere with the response during the second TR.. If all you hear is the TR click, you might have to change from left to right stereo channel.. Either pre-edit the recording so you only have the correct channel, or change the code to use soundfile.. channel(1); or soundfile.. channel(2);.. Procedure.. Install ChucK from Princeton's site (.. Download ChucK.. Download my program.. echocancel.. ck.. Use ChucK to run my program.. Offline usage: chuck echocancel.. ck:yourNoisyFile.. wav..

    Original link path: /code/echocancel/
    Open archive
  •  

  • Title: Adaptive Reading Agent Simulator
    Descriptive info: This code simulates an adaptive reading agent that learns to control its saccadic eye movements in order to read as quickly as possible.. This program runs in a GUI.. Simply double-click ARAS.. jar to get started.. On the first page, you specify the lengths of the words in the sentences for  ...   word, 5 means a 5-letter word, etc).. Source code is available upon request.. Download.. ARAS.. jar.. and double-click to run it.. (You must have Java installed.. ).. The program outputs its results in MATLAB code that can be used to plot the results.. (It saves an M-file in the current directory.. Screenshot:..

    Original link path: /code/aras/
    Open archive

  • Title: Recurrent McCulloch-Pitts Network
    Descriptive info: This code simulates a recurrent McCulloch-Pitts neural network like those used by Chip Levy to model hippocampal region CA3.. The program Simulation.. java runs a random network without any learning.. The program SimulationLearning.. java trains and tests a network on a sequence specified by a "levy.. prop" file.. Examples of "levy.. prop" files are contained in the documentstion.. Obtain source code from GitHub (.. https://github.. com/plaurent/mcpstdp..

    Original link path: /code/pakllevy/
    Open archive

  • Title: Index of /code/svmweights
    Descriptive info: Index of /code/svmweights.. Name.. Last modified.. Size.. Description.. Parent Directory.. -.. getWeightsFromSVM.. m.. 09-Nov-2011 10:57.. 680.. Apache/2.. 2.. 22 (Ubuntu) Server at pakl.. net Port 80..

    Original link path: /code/svmweights/
    Open archive

  • Title: ASL Eye Tracker Driver
    Descriptive info: Use this driver in case you would like to read information from an ASL Eye Tracker over a serial connection.. This is useful for gaze-contingent paradigms.. To test this out, you can run the EyeTrackerDriver on its own from the command line and it will output gaze coordinates from the eye tracker in real time , e.. java net.. pakl.. thesis.. drivers.. EyeTrackerDriver COM2.. Download RXTX from.. here.. Download my ASL Eye Tracker Driver from.. Compile and run, using java -Djava.. library.. path=/your/rxtx/jnilib/directory..

    Original link path: /code/asleyetrack/
    Open archive

  • Title: About | The Bottom Half
    Descriptive info: This site collects interesting bits of code I come across or create as I do my work mostly in.. You ll find all sorts of things here, including code, links to resources, demonstrations of some of my findings, and potentially even tools that might be of use to you.. Enjoy!.. Patryk.. Note: What is a.. Bottom Half.. anyway? A bottom half refers to an aspect of the Linux kernel that allows tasks to be scheduled efficiently.. Let me refer you to the following definition of the bottom half from Linux Device Drivers, 3rd Edition :.. The  ...   The big difference between the top-half handler and the bottom half is that all interrupts are enabled during execution of the bottom half—that s why it runs at a safer time.. In the typical scenario, the top half saves device data to a device-specific buffer, schedules its bottom half, and exits: this operation is very fast.. The bottom half then performs whatever other work is required, such as awakening processes, starting up another I/O operation, and so on.. This setup permits the top half to service a new interrupt while the bottom half is still working..

    Original link path: /blog/?page_id=8
    Open archive

  • Title: Applescript terminal monitoring | The Bottom Half
    Descriptive info: Post navigation.. Previous.. This entry was posted in.. Bookmark the.. permalink..

    Original link path: /blog/?p=110
    Open archive

  • Title: patryk | The Bottom Half
    Descriptive info: Author Archives:..

    Original link path: /blog/?author=1
    Open archive

  • Title: Uncategorized | The Bottom Half
    Descriptive info: Category Archives:..

    Original link path: /blog/?cat=1
    Open archive



  •  


    Archived pages: 32