Playing with Semantic Memory

Slides:



Advertisements
Similar presentations
Integrated Episodic and Semantic Memory in Robotics Steve Furtwangler, with Robert Marinier, Jacob Crossman.
Advertisements

1 Episodic Memory for Soar Agents Andrew Nuxoll 11 June 2004.
Impact of Working Memory Activation on Agent Design John Laird, University of Michigan 1.
1 Soar Semantic Memory Yongjia Wang University of Michigan.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Understanding Allocations Brian Chizever Cognos Corporation.
SIMPLE Drafts Jonathan Rosenberg dynamicsoft. Presence List Changes Terminology change Presence List Information Data Format –Provides version, full/partial.
A Pure Java Implementation of Soar Dave Ray
Intro to Planning Or, how to represent the planning problem in logic.
Visual Basic for Application - Microsoft Access 2003 Finishing the application.
Week 10 - Wednesday.  What did we talk about last time?  Method example  Roulette simulation  Types in Java.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Five todos when moving an application to distributed HTC.
December 1, 2006©2006 Craig Zilles1 Threads & Atomic Operations in Hardware  Previously, we introduced multi-core parallelism & cache coherence —Today.
Advanced Excel Helen Mills OME-RESA.
Jacob Crossman With help from Bob Marinier Anthony Deschamps
Action Modeling with Graph-Based Version Spaces in Soar
Modeling Primitive Skill Elements in Soar
Databases: What they are and how they work
Outline The basic authentication problem
Data Virtualization Demoette… Logging in CIS
Debugging Intermittent Issues
Static data members Constructors and Destructors
May 17th – Comparison Sorts
Creating LOVs and Editors
Loops BIS1523 – Lecture 10.
Lower bounds for approximate membership dynamic data structures
Prof. Dr. Holger Schlingloff 1,2 Dr. Esteban Pavese 1
Finding a Path With Largest Smallest Edge
Addressing Pushback from Patients
Atomic Operations in Hardware
Atomic Operations in Hardware
Executable Specification for Soar Theory
Debugging Intermittent Issues
Lecture 25 More Synchronized Data and Producer/Consumer Relationship
B+-Trees.
COMP 430 Intro. to Database Systems
Data Science Algorithms: The Basic Methods
Cse 373 May 15th – Iterators.
Lecture 5: GPU Compute Architecture
Basic SQL Lecture 6 Fall
Soar 9.6.0’s Instance-Based Model of Semantic Memory
Sentinel logic, flags, break Taken from notes by Dr. Neil Moore
Achieving parsimony between NGS and the Michigan approach
CSE 341: Programming Langs
John Laird, Nate Derbinsky , Jonathan Voigt University of Michigan
Lecture 5: GPU Compute Architecture for the last time
Sentinel logic, flags, break Taken from notes by Dr. Neil Moore
John E. Laird 32nd Soar Workshop
Present by Andie Saizan, MCP
Spreading With Edge Weights
Phil Tayco Slide version 1.0 Created Oct 9, 2017
Lecture 22 Inheritance Richard Gesick.
SoarUnit Bob Marinier 11/29/2018.
Bryan Stearns University of Michigan Soar Workshop - May 2018
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis.
Soar IDE 2.0 Bob Marinier, Kyle Aron, Preetom Chakraborty 12/8/2018.
DONE Need password feature
CSCE 489- Problem Solving Programming Strategies Spring 2018
Spreadsheets, Modelling & Databases
Data Structures Unsorted Arrays
This Lecture Substitution model
Why we have Counterintuitive Memory Models
Review of Previous Lesson
Remembering and Learning
Kittiya Poonsilp, Rujijan Vichivanives, Attakorn Poonsilp
Word Masterclass By Dan Carline.
Time Complexity and the divide and conquer strategy
Presentation transcript:

Playing with Semantic Memory Bob Marinier 11/22/2018

Motivations for Semantic Memory Expensive rules Data chunking / learning Runtime query construction Limit the size of WM (possibly to help epmem) Take advantage of underlying database Pre-load data Maintain data across runs Data chunking example: if we want to learn that the capitol of the US is DC, then we have to bend over backwards to learn a rule like “capitol of US => DC”. And that rule is still incapable of answering the question “What country is DC the capitol of?” Query construction example: find me a blue car with a flat tire. With just those 3 features (color, vehicle type, tire status), you’d have to write at least 7 rules (assuming values could be variablized). What if you had 100 features? What if you didn’t know what the features were, or how many you’d need to simultaneously match on? 11/22/2018

Example (from Soar manual) sp {smem*sample*query (state <s> ^smem.command <sc> ^lti <lti> ^input-link.foo <bar>) --> (<sc> ^query <q>) (<q> ^name <any-name> ^foo <bar> ^associate <lti> ^age 25) } Name can be anything (wildcard) Foo’s value must match whatever <bar> is bound to Associate’s value must be the LTI bound to <lti> Age’s value must be 25 11/22/2018

Semantic Memory Does Not: Retrieve multiple matches at once Support arbitrary partial matching Support deep structure matching Support variablize attributes Support less than/greater than matching Support negative queries Support special spatial queries Prove P=NP Solve world hunger The way people talk about semantic memory sometimes, it seems that there are some misconceptions 11/22/2018

Looping to Retrieve Multiple Matches Looping in semantic memory: 3 methods Build up a prohibits set As each item is retrieved, add its LTI to the prohibits For large sets, this doesn’t scale well Modify the memories so they don’t match anymore Scales much better, but requires data to share some flag Retrieve linked LTIs (walk a list) Scales even better since there is no match cost, but requires data to be structured as a list Compared to writing a single expensive rule, writing the many rules to do either of these patterns is a lot of work So I started extending the Dave Ray’s bebot library 11/22/2018

Generic Bebot Loop Proposal sp {propose*bebot*smem*loop (state <s> ^name test-smem-loop -^result) --> (<s> ^operator <o> +) (<o> ^name bebot*smem*loop ^query <query> ^func my-function-operator ^tcnum-attr my-tcnum-attr # optional ^next-attr my-next-attr # optional ^allow-chunks true # optional; default false ^init my-init-operator # optional ^test my-test-operator # optional ^return my-return-operator) # optional Performs all work in a substate, with result returned to superstate query: the cue to give to semantic memory func: operator to propose for each retrieved value (you must write the apply rule(s)) tcnum-attr is optional (if not supplied, will use prohibits) By default chunking is disabled. Can enable it with ^allow-chunks true (learning still needs to be on) Can also specify operators for init, loop condition testing, and returning results (but defaults exist for all of these). For any specified operators, have to write appropriate apply rules 11/22/2018

Bebot Example: Retrieve first n values sp {propose*bebot*smem*retrieve-n (state <s> ^name test-smem-retrieve-n -^result) --> (<s> ^operator <o> +) (<o> ^name bebot*smem*retrieve-n ^query <query> ^n 3) (<query> ^value <v>) } 11/22/2018

Example: get two smallest values in a set (Expensive rule) sp {search-wm*return-result (state <s> ^name search-wm ^values <vals> ^superstate <ss>) (<vals> ^value <v1> {<v2> < <v1>}) -(<vals> ^value {<v3> <> <v2> < <v1>}) --> (<ss> ^min-values <mv>) (<mv> ^value <v1> <v2>) } 11/22/2018

Example: get two smallest values in a set (Bebot) sp {propose*bebot*smem*loop (state <s> ^name test-smem-loop -^result) --> (<s> ^operator <o> +) (<o> ^name bebot*smem*loop ^query <query> ^func func-two-min-vals ^tcnum-attr tcnum) (<query> ^value <v>)} sp {apply*func-two-min-vals*first (state <s> ^operator <o>) (<o> ^name func-two-min-vals ^object.value <newval> ^previous <p>) -(<p> ^value) (<s> ^result <p>) (<p> ^value <newval>)} sp {apply*func-two-min-vals*second (<p> ^value <v1> -^value <> <v1>) sp {apply*func-two-min-vals*too-large (state <s> ^operator <o>) (<o> ^name func-two-min-vals ^object.value > <v2> ^previous <p>) (<p> ^value <v1> ^value {<v2> > <v1>}) --> (<s> ^result <p>)} sp {apply*func-two-min-vals*replace-value ^object.value {<newval> < <v2>} (<s> ^result <p>) (<p> ^value <v2> - <newval>)} 11/22/2018

Performance Results: Time (get 2 smallest values) These results from csoar 9.3.1 WM-rule: expensive rule – kills reactivity WM-ineqop: using identifier ordering to process objects like a list. Slow, but remains reactive WM-list: storing objects in a list and using bebot’s list processing (note, this doesn’t scale in jsoar because of a bug fix that hasn’t been ported) Smem-prohibit: using prohibits list Smem-modify: modifying memories Smem-list: storing objects in a list in smem and doing a NCB retrieval to get the next item 11/22/2018

Performance Results: Time (get 2 smallest values) 11/22/2018

Performance Results: Throughput (get 2 smallest values) Looks like list processing slows down over time Early list craziness probably due to memory pools being initialized? 11/22/2018

Performance Results: Throughput (get 2 smallest values) Indeed, at large set sizes, smem is faster when using the modify or list approaches The degradation over time is probably due to the backtrace building up, but I’m not sure why it affects the WM version more than the smem versions 11/22/2018

Should I Use Semantic Memory? Yes No Simple rules too expensive Data learning Runtime query construction Can’t use WM Need a small WM Can’t maintain data in a WM list Want database guarantees Need to pre-load lots of data Need to maintain data across runs Simple rules work well Performance matters and don’t need a general solution Need to do queries smem doesn’t support Need a stable system 11/22/2018

More Information Soar 9.3.1 manual Bebot: https://github.com/daveray/bebot 11/22/2018

Nuggets Coal Smem really does work May be able to capture some common usage patterns in a reusable library Even when slow, still maintains reactivity Underlying database can be useful Starting to understand some use cases where it makes sense Requires more work to use than expensive rules Maybe not the best for extensive looping over sets Prohibit approach doesn’t really scale Architectural support for iterators/cursors might be nice Best uses cases still not well understood 11/22/2018