USCISIUSCISI Tuning for Performance Outline of talk: Classifier Performance Recognizer Performance Performance Tips CLOS Instances and the Backchainer.

Slides:



Advertisements
Similar presentations
Dr. David A Ferrucci -- Logic Programming and AI Lecture Notes Knowledge Structures Building the Perfect Object.
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Artificial Intelligence Description Logics - Background and Motivation for DL Relation between DL and FOPL (extensional Semantics) Example.
Artificial Intelligence Description Logics see references last slide.
Semantics Static semantics Dynamic semantics attribute grammars
Naïve Bayes. Bayesian Reasoning Bayesian reasoning provides a probabilistic approach to inference. It is based on the assumption that the quantities of.
Justification-based TMSs (JTMS) JTMS utilizes 3 types of nodes, where each node is associated with an assertion: 1.Premises. Their justifications (provided.
Truth Maintenance Systems. Outline What is a TMS? Basic TMS model Justification-based TMS.
Default Reasoning the problem: in FOL, universally-quantified rules cannot have exceptions –  x bird(x)  can_fly(x) –bird(tweety) –bird(opus)  can_fly(opus)
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
USCISIUSCISI Using Time in Loom Thomas A. Russ USC Information Sciences Institute.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic.
1 A Description Logic with Concrete Domains CS848 presentation Presenter: Yongjuan Zou.
USCISIUSCISI Frequently Asked Questions Why Don’t Instances Get Recognized? Use of “:all” Use of “:for-all” Compiling Loom Code Combining Number Restrictions.
ISBN Chapter 3 Describing Syntax and Semantics.
Chapter 12: Expert Systems Design Examples
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Chapter 14 (Web): Object-Oriented Data Modeling
Object-Oriented Databases
USCISIUSCISI Loom: Basic Concepts Thomas A. Russ USC Information Sciences Institute.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Describing Syntax and Semantics
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
10/3/2000SIMS 257: Database Management -- Ray Larson Relational Algebra and Calculus University of California, Berkeley School of Information Management.
Chapter 14: Object-Oriented Data Modeling
PHP Workshop ‹#› PHP Classes and Object Orientation.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity and Security Domain Constraints Referential Integrity Assertions Triggers.
Ontology Development Kenneth Baclawski Northeastern University Harvard Medical School.
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
USCISIUSCISI Modeling in a Medical Domain Basic Concepts Using Recognition More Sophisticated Relations Methods, Actions and Production Rules.
USCISIUSCISI Procedural Programming Outline of talk: Deductive Kb with Multiple Paradigms Production rules Methods Lisp-to-Loom Interface Interpretations.
USCISIUSCISI Background Description Logic Systems Thomas Russ.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
IDB, SNU Dong-Hyuk Im Efficient Computing Deltas between RDF Models using RDFS Entailment Rules (working title)
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Guide to State Transition Diagram. 2 Contents  What is state transition diagram?  When is state transition diagram used?  What are state transition.
ClassesPHPMay-2007 : [‹#›] PHP Classes and Object Orientation.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
USCISIUSCISI Basic Introduction to Loom Thomas A. Russ USC Information Sciences Institute.
Object-Oriented Data Modeling
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Chapter 3 Part II Describing Syntax and Semantics.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
OilEd An Introduction to OilEd Sean Bechhofer. Topics we will discuss Basic OilEd use –Defining Classes, Properties and Individuals in an Ontology –This.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
USCISIUSCISI Miscellaneous Issues Frame Functions Saving and Restoring CLOS Classes Mix and Match Inferencing.
Marwan Al-Namari Hassan Al-Mathami. Indexing What is Indexing? Indexing is a mechanisms. Why we need to use Indexing? We used indexing to speed up access.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Session 1 Module 1: Introduction to Data Integrity
Fundamentals, Design, and Implementation, 9/e Appendix B The Semantic Object Model.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Review: What is a logic? A formal language –Syntax – what expressions are legal –Semantics – what legal expressions mean –Proof system – a way of manipulating.
DBC NOTES. Design By Contract l A contract carries mutual obligations and benefits. l The client should only call a routine when the routine’s pre-condition.
Of 29 lecture 15: description logic - introduction.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
1 Overview of Query Evaluation Chapter Outline  Query Optimization Overview  Algorithm for Relational Operations.
Ccs.  Ontologies are used to capture knowledge about some domain of interest. ◦ An ontology describes the concepts in the domain and also the relationships.
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Artificial Intelligence Logical Agents Chapter 7.
LECTURE 10 Semantic Analysis. REVIEW So far, we’ve covered the following: Compilation methods: compilation vs. interpretation. The overall compilation.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
Chapter 6: Integrity (and Security)
Record Storage, File Organization, and Indexes
ITEC 3220A Using and Designing Database Systems
Presentation transcript:

USCISIUSCISI Tuning for Performance Outline of talk: Classifier Performance Recognizer Performance Performance Tips CLOS Instances and the Backchainer

USCISIUSCISI Performance Where does the time go? In some systems, slow performance is due to poorly-tuned code. In Loom, slow performance can result from the enormous amount of inferencing that occurs under the hood.

USCISIUSCISI Classifier Performance Classifier Phases (1) normalization (compute closure of ~100 inference rules) (2) classification (compute subsumption links — very fast) (3) completion (normalize constraints) (4) sealing (compile access functions)

USCISIUSCISI Classifier Performance Classifier Phases (1) normalization (3) completion (2) classification (4) sealing Bulk of time is spent in phases (1) and (3), normalizing features: (i) start with local features (:at-most, :at-least, :all,...); (ii) inherit features from parent concepts; (iii) compute larger set of features (deductive closure); (iv) keep only the most specific features; (v) classify the remaining features.

USCISIUSCISI Speeding Up Normalization Each constraint in Loom represents a rule of inference (not just a type check). The overhead of normalization depends on the number of features per concept (it’s estimated to be quadratic in the number of features). So, a simple way to speed up an application is to specify fewer constraints :-).

USCISIUSCISI Speeding Up Normalization (cont.) Loom permits you to lobotomize the classifier “(power-level :medium)” causes Loom to ignore a few of the most expensive normalization rules. “(power-level :low)” causes Loom to make a single pass over the normalization rules (rather than computing their closure).

USCISIUSCISI Load-Time vs. Run-Time Classification Most applications perform the bulk of classification at load time; for them, speed of classification may not be critical. – Normally, run-time production of new system- generated descriptions will quiesce (no more “.”s and “+”s);

USCISIUSCISI Recognizer Performance An explicit call by an application (e.g., (tellm)) triggers reclassification of updated instances. Recognition strategy: For each instance on the queue (1) normalize asserted and inherited features; (2) classify the instance; (3) install dependency bombs (TMS monitors); (4) test for incoherence; (5) propagate forward constraints. Steps 1-5 are applied to each instance at least two times (once each in strict and default mode).

USCISIUSCISI Classifying Instances During the recognition process, each feature in a concept definition represents a miniature query. Examples: (:at-least k R) Retrieve fillers of the role R; Succeed if the number of fillers is at least k. (:at-most k R) If role R is closed, retrieve fillers of the role R; Succeed if the number of fillers is at most k. (:all R A) If role R is closed, retrieve fillers of the role R; Succeed if each of the fillers satisfies the concept A. The bulk of recognition time consists of computing feature satisfaction and truth maintaining the results.

USCISIUSCISI Testing for Closed Roles Probing features such as (:all R A) or (:at- most k R) usually entails proving that the role R is closed. This test is fast if R has the :closed-world property, or R is :single-valued and a role filler exists. Tip : Always specify the :single-valued and :closed-world properties on relations whenever they are valid for your application domain.

USCISIUSCISI Subtlety in the semantics of role closure: (defconcept A :implies (:at-least 1 R)) (defrelation R :characteristics (:closed-world)) (tell (Thing Joe) (A Fred)) The role “(R of Joe)” is closed, but the role "(R of Fred)” is not closed.

USCISIUSCISI Domain and Range Constraints Tip : Always specify domain and range constraints for a relation (unless they are inherited from a parent relation). (defrelation R :domain A :range B) (tellm (R Fred Joe))  Loom infers that Fred satisfies A and that Joe satisfies B. (defconcept A :implies (:exactly 1 R)) (defrelation R :domain A)  Loom infers that R is :single-valued.

USCISIUSCISI Performance Warnings A ``no generator found'' performance warning indicates that a query will exhibit abysmal performance. Slower (sometimes) : (retrieve (?x ?y) (R ?x ?y)) Faster (sometimes) : (retrieve (?x ?y) (and (A ?x) (R ?x ?y))) If no domain is specified for R, the slower query will scan the entire kb to generate bindings for ?x.

USCISIUSCISI Performance Tips: Tip : Always rephrase definitions or queries to eliminate performance warnings. Tip : Never wrap an eval around an ask or retrieve unless you are single, childless, and have no desire to graduate, e.g., (eval `(retrieve (?y) (and (R,foo ?y) (A ?y))) Tip: To programmatically compose a query on the fly, use “query” or bind variables: (query ‘(?y) `(and (R,foo ?y) (A ?y))) (let ((?x foo)) (retrieve (?y) (and (R ?x ?y) (A ?y)))) Better!

USCISIUSCISI :perfect relations Marking a concept or relation :perfect tells Loom that facts about it cannot change. Tip : Use of the :perfect properties reduces match overhead. Tip : Computed relations are prime candidates for the :perfect attribute. (defrelation <> :domain Number :range Number :characteristics (:symmetric :perfect) :predicate /= )

USCISIUSCISI How to Get No Recognition The overhead of instance classification (recognition) is eliminated if you specify as a creation policy :clos-instance or :lite- instance. Deduction over CLOS instances and LITE instances is backward chained, with no caching. However (there is always a catch) inference without instance classification is strictly weaker than inference with it.

USCISIUSCISI Deduction with CLOS and LITE Instances With creation policy set to :clos-instance or :lite-instance inference is performed using backward chaining. The backchainer recognizes rules of the form (implies A B) and (implies B) but ignores rules of the form (implies A )

USCISIUSCISI Backward chaining and type restrictions The design decision not to chain backwards across value restrictions was a judgment call. (defconcept A :implies (:all R B)) (tell (A Fred) (R Fred Joe)) (ask (B Joe)) --> ??? The recognizer will prove that Joe satisfies B; the backchainer won't.