Jared's work log

From OpenCog
Jump to: navigation, search

2008

July

  • Moved the attention-related comparison operators
  • Made a general filter for the AtomSpace, and added a method to get only atoms in the AttentionalFocus, and some filters for STI or LTI threshold

November

  • Added the mind agent configuration framework (you can provide default parameters, and get a print-out of the parameters for an Agent)

December

  • Fixed up the IndefinitePLNFormulasUTest
  • Added copyright headers for PLN
  • Converted PLN's Tester.cc into a separate unit test, fixed up other PLN unit tests
  • Got PLN to use the OC XML loader instead of the PLN-specific one
  • Made PLN a loadable module, and adapted the shell commands for the CogServer shell
  • Changed Node and Link ::toString methods to output the name of the atomtype, not the number.
  • PLNModule doesn't automatically load test data files (which would be inappropriate in contexts other than testing PLN)
  • Removed a bunch of PLN haxx
  • Moved testAtomSpaceWrapper to a separate cxxtest file.
  • PLNModule supports full names for commands. Replaced most of the command letters with full names.
  • Added a cogserver XML save command.
  • Added AtomSpaceWrapper::makeTheorems()
  • Helped Nil and Predrag to fix several bugs in MOSES.

2009

January

  • Added commands to start or stop Agents, list running Agents, and stop/start the CogServer Agent loop.
  • User:Joel Pitt debugged CogServer crashing when start-agents or stop-agents were used, and I fixed it with mutexes.
  • Adapted ImportanceDiffusion to use Boost sparse matrixes
  • Talked with Joel Pitt about Tasks [a framework that was in the original Novamente codebase], including re the PLN task, and about ECAN RFSes (requesting a Link, then agents can find it and they will get STI/LTI from the one that requested it). So that will provide an explicit mechanism for agents to work together re specific atoms.
  • Implemented the Scheme command pln-bc, which runs some PLN backward chaining inference on a specified target atom.

February

  • Implemented the initial OpenCog atomspace visualizer using Ubigraph
  • Got PLN to run with more than one BIT at once.
  • Met with Joel Pitt and a bunch of Ben's old friends (including one of my previous lecturers). Me and Joel talked about building parallelism into the design in advance, and using BigTable; we worked out how PLN revision should work in the current design [with VersionHandles instead of duplicated atoms]; did some work on removing FWVariableNodes from the AtomSpace
  • Added a prototype PLN BC agent (later it'll have a function to choose which atoms to target, currently it just chooses at random)

March

  • Made the PLN demo instructions at PLN_usage
  • Talked to GSOC students
  • Updated test_hopfield.sh for new verbosity flag

April

  • Commented out / removed / marked a bunch of PLN dead code

May

  • Fixed the PLN arguments error
  • Converted PLN TODO comments into doxygen format
  • Added a PLN BIT visualizer, and BITNode sizes and labels

June

  • Making detailed tutorials/examples for PLN Rules
  • Being an unofficial co-mentor for kizzo
  • PLN dead code: Replaced all uses of the type2name map (which isn't initialized anywhere), with Type2Name (which just uses ClassServer to get that info). This resulted in a change of output from "Link2Link (=>)" to "Link2Link(InheritanceLink=>ExtensionalInheritanceLink)".
  • Made a PLN unused tests directory, and moved the PLN test stuff to a new tests/reasoning/pln directory (instead of tests/reasoning). This is more consistent with opencog/reasoning/pln.
  • Cleaned up BITUbigrapher and pushed it to trunk. Fixed some issues with compile when Ubigraph isn't installed.
  • Had a big chat with several new people. Helped dissipate/Steve get started on setting up the Embodiment code to make a simple HOWTO.
  • Did a whole bunch of stuff in PLN:
    • improved some documentation
    • pln-bc doesn't stop when it gets one result
    • Share the BackInferenceTree between the pln-bc Scheme command and the other PLN commands, so they can be run on it too
    • Put PLN defaults in opencog.conf as well, so you can edit the parameters without needing to look them up in the code

July

  • Integrating Gama's REST changes into the current trunk.

September

  • Converted PLN test files into Scheme
    • Not used yet, need to fix archiveTheorems
  • pln-bc reuses the existing BIT if you run it on the same atom twice+ in a row.
  • Made PLNUTest output clearer (tells you what the numbers it's displaying actually are)
  • Started on the new PLNUTest.

October

  • Did several more hours on the new PLNUTest.
  • Talked with YKY about PLN and Bayes Nets
  • Had a look over the AtomTable index system.

From the 29th, I've more-or-less finished university for the year, so I'm getting more active :)

  • Implemented the new PLNUTest
  • Having a look at ModusPonensRule. This, DeductionRule, and LookupRule could be the only Rules we would need for basic natural-language inference.
  • Finished implementing the new PLNUTest.

November

  • Ported most of the PLN tests over to the new PLNUTest. A lot of them don't work (due to issues with PLN, not the unit test, AFAICT).
  • Had some discussion with Nil about the TableGather code and the AtomSpaceWrapper API and how to make it cleaner.
  • tty1 from the dANN project is interested in combining our work.
  • Nov 9:
    • Discovered that LookupRule does skip 0-confidence atoms, but that's done by TableGather::gather. The issue was in ForceTargetVirtual, which (oddly?) takes the Atom that is the target, adds it as a result (even though it's 0-confidence), and makes the virtual version.
    • Got it to convert the target into a vtree, and that solved the problem (and also the problem of repeating TVs, which would be when more direct_results are reported).
    • Also, semi-understood how to make a PLN forward chainer correctly. (I'll write it up sometime, and possibly understand it more in the meantime ;) ).
  • Providing documentation of how PLN Rules and associated methods work. Nil and I are working that out so he can finish IntensionalInheritance (just making it work with the BIT).
  • Helped Dylan Lloyd with some of the compilation problems on Ubuntu 9.10.
  • Week of Nov 16-22:
    • Fixed the other PLN tests - now all the ones, that were suitable to port, work.
    • Gave the PLNUTest semi-robust error handling, so it should tell you what went wrong most of the time.
    • Added a README for the PLN test directory
    • Adapted PLNUTest to use the Scheme versions of the test files.
    • Enabled a few basic tests of individual rules, that use a Scheme data file (I prepared these earlier).
    • Made tests for DeductionRule and ModusPonensRule.
  • Week of Nov 23-29:
    • Getting used to new computer (way faster), and copying stuff over.
    • Tried (unsuccessfully) to get Embodiment working. The problem is the lack of a good Windows computer to run the Multiverse client on (and virtualization not working).
    • Made tests for InversionRule and NotEvaluatorRule.
    • Fixed the XML and SCM files -> all PLN tests pass (again)
    • Fixed PLNUTest's ability to use different heuristic functions (best-first, random, softmax). Currently, softmax is worse, and random is really bad, finding very long inference paths. Interestingly, changing the heuristic tends to result in different TruthValues being found, which may be why Ari gave them an interval of acceptable values.
    • Helping Matt Chapman get started.
    • Tried out indefinite probabilities. It seems to work (but only for some formulas; the code needs work).
    • Using parsed NLP datasets.
      • Tried MIT ConceptNet. Looks cool in ubigraph: http://yfrog.com/33vpmp
      • PLN can't even find the TVs of existing atoms (in a dataset this size). The BIT can get huge when trying to, even with a relatively small number of steps allowed. I suspect this is because at some points it finds a vast number of possible direct results (existing atoms) and spawns a new BITNode for each one (basically). Also quite a few FWVariableNodes.
      • Using linas's demo combined with this dataset. Takes a long time, though it doesn't increase mem usage.
        • It wasn't due to the atoms already having connections.
        • PLN can effortlessly do it if you change the demo to use InhLink
      • ImportanceDiffusion can effortlessly run on the ~10,000 atoms.

December

  • Tested IntInhRule and SubsetRule. They work in the new pln-ar function, but not in the BIT.
  • Fixed the handling of signals in Ubigrapher.

Testing Rules on NLP data

  • Converted the dataset to use InheritanceLinks instead of the "isa" predicate. PLN is able to do basic reasoning on isa-type sentences, efficiently, on a dataset with a few thousand sentences and about 10,000 Atoms.
  • And handle deduction and transitive/reflexive/symmetric relations.
  • And the basic use of ImplicationLinks (i.e. one fact implies another).
  • Fixing up SimSubstRule1. It now compiles and works.
  • Made the reverse version of that Rule (via a Boolean in the same class, rather than duplicating much of the code)

2010

January

  • Got the chatbot going. It's still a bit broken for NLP/PLN experiments.
  • pln-bc now returns the resulting atom.
  • Fixed SubsetEvalRule and IntensionalInheritanceRule with respect to backward chaining.
  • Fixed SimSubstRule. Unfortunately it makes one of the (unrelated) test targets take too long/forever.
  • Misc PLN cleanup.
  • Tried (only semi-successfully) to make the BIT memory-manage FWVars.

February

  • Misc PLN test cleanup.
  • Made inference work efficiently with SimSubstRule, by stopping it from doing some things, including trying to produce the same Atoms that deduction-based Rules could.
  • Port the tacky targets in TestTargets.h into real tests.
  • Implemented a PLN forward chainer. The core algorithm is robust, but some Rules haven't been adapted yet, and there are also efficiency issues.
  • Adapted PLNUTest to also test the forward chainer.
  • Tried out MacroRuleTest (it crashes).
  • Added a test in TableGatherUTest for FWVar matching and getting the binding info.
  • Added a simple script to make a randomly-connected AtomSpace. The forward chainer gets an error related to the AtomSpace's mapping between pHandles and real Handle/Version pairs.
  • Fixed an issue where UbigraphModule wasn't registering for the Add/Remove Atom signals.
  • Re-enabled NotEvaluatorRule.
  • Initial "scouting" about RelEx2Frame output and how usable it would be for inference.

March

  • Working on commands to load a .conf test while using the cogserver.
  • Forward chaining agent, experiments, bug fixing.
  • Helping Jekin with the web module.
  • Finally installed the right Luabind, so I'll try out virtual pets again.
  • Profiled PLNUTest (lightly).
  • Experimenting with RelEx2Frame to see how (well) it handles various things.
  • Met up with Joel Pitt and talked over various things.
  • Having detailed conversations with Linas about querying, vtrees and unifying libquery.so with PLN's mechanisms.

April

  • Making PLN forward chaining support a few remaining Rules (at least the ones that are still used).
    • Fix ModusPonens by adding a custom fullInputFilter() method (the first Rule I've had to do this for).
  • Get FC to add atoms with fresh=false, which turned out to be much more efficient (avoiding a time explosion as more Atoms are added)

May

  • Made TableGather allow subclasses of the root vertex's Type(according to the documentation it is meant to do that). It turned out a lot of Rules only work in FC if you do that. The BC now finds extra inference paths (that are still valid).
  • It was then possible to make SubsetEvalRule and IntensionalInheritanceRule work (although with many dud inputs). Changed them to simply produce a (0,0) TV if some required Atoms were missing, rather than having an assertion fail.
  • Working out how to make ForAll unification (CustomCrispUnificationRule) work in forward chaining.
  • Investigating how CrispTheoremRule works, and whether other Rules could replace it (since they are compatible with FC)
  • Talking with YKY about OpenCog and how it compares to his AGI ideas.
  • Made FC support trails.
  • Tried getting FC to use more than one combination of inputs for each Rule each step (since the big bottleneck is looking them up in the AS, and it has to look them up each step anyway). It's faster, but there's still a combinatorial explosion issue.

June

  • Fixed the combinatorial explosion issue, by getting the FC to only use deduction-like Rules, and use the backward chainer to evaluate AND/OR/NOT/Subset/etc expressions.
  • Fix some bugs that caused crashes, and tried to make FC handle more cases of ForAll expressions.
  • Integrate the changes from March to remove the AtomSpaceWrapper pHandle-to-Handle map.
  • Try out a tacky prototype way of reusing the BITNodes from previous inferences. It tends to use at least 10x less BITNodes each time (than it would otherwise).
  • Discovered that CrispTheoremRule can actually be removed (i.e. is redundant), but the BIT search takes a lot longer...
  • Unified the MPunify methods. The new version is a lot faster with large AtomSpaces (including when FC produces a lot of Atoms).
  • Successfully got FC to handle more ForAll cases (though not all), by using the BIT (and allowing it to prove expressions with multiple FWVars in them).

July

  • Thinking about how to do do inheritance-substitution without a separate Rule, or how to use that fact to do the math within a separate Rule.
  • Checking out the wordnet integration in Embodiment (which does something similar to inh-subst, with the isa and partOf relations).
  • Read all of the Scheme code for Embodiment NLP. Thinking about how to use PLN with it.
  • Investigating tree::size() which is a major bottleneck for PLN.
  • Exploring skolemization as a way to handle Exists quantifiers. Also considering how to produce ForAll links. This could make the forward chainer fully general and may be necessary to handle frames. Update: It turns out that it actually fills in the premises of an implication where possible (by just finding every match). So producing ForAll links is only necessary (including in FC) if you actually want to be able to use them later.
  • Looked at Ari's skolemization approach. S. won't be able to handle quantifiers within Implications, so it might be necessary to handle Exists separately. Reading the existing literature about ways to do this. Use "Existential introduction" and "Existential instantiation" on each ExistLink. Maybe Scholemise Exists within ForAll in those cases where you can.
  • Improving the BIT visualizer.
  • Refactored the PLN testing framework. Put the infrastructure part in the PLN module so it's easily accessible in CogServer or (potentially multiple) UTests.
  • Tested the BIT fitness function with some parts disabled. If you disable the solution_space part PLN becomes about twice as fast! (And can pass the simple scaling_test I made).

August

  • Got a basic Embodiment/NLP => PLN => NLGen pipeline working (more or less).
  • Read about some existing NLP+reasoning or Frames+reasoning work.
  • Got the existing integration with the WordNet ontology working a bit better. Experimenting with WordNet+PLN. PLN looking up an Atom (LookupRule) takes about a second each time when there are 1.5m Atoms. The AS can look them up directly in a fraction of a second...
  • Refactored the PLN test infrastructure to be more elegant/be easier to add to/work better.
  • Improved the BIT visualizer to be a lot more useful.
  • Reviewed David Crane's dimensional embedding code.

September

  • Worked out how to handle InheritanceLinks and ImplicationLinks occuring in natural language. (i.e. "is" or "if...then" sentences.) Producing ImplicationLinks with variables and quantifiers (from sentences) will be a lot more subtle, and can be safely left for later. This provides an easy way to get ImplicationLinks for some early experiments. See Frame2PLN.
  • PLN can now handle the Mortal Socrates syllogism (although only if you change the name e.g. to John; there is an issue in Relex2Frame)
  • Make forward chaining incremental (a la AIMA, use all knowledge the first time, then only do inference steps involving that knowledge, and so on.
  • Switched off the heuristic where target size increases the priority. This makes PLNUTest 3-4 times faster overall; may slow down some cases (larger cases?)
  • Make ANDBreakdownRule work (i.e. produces A from AND(A B C...). It currently doesn't work on ANDLinks in a different order, which is wrong (maybe it relied on something being different in an ancient version of the code)
  • Remove some redundant forms of inference.
    • Don't use ModusPonens to produce an ImplicationLink (i.e. using (Imp A (Imp B C)) to produce (Imp B C), probably to use in another, higher ModusPonens instance.
    • Using ModusPonens twice or more in a row (just use MP at the top and DeductionRule in between). (Actually, that one's wrong, but there is some form of redundancy between them...)
    • Don't allow various things under an ANDBreakdownRule (including other copies of ANDBreakdownRule)
  • Thought of an improvement to OpenCogPrime:AdaptiveInferenceControl that should automatically give up on branches that turn out not to be as promising as expected, and various other cool things.
  • Fixed up Equi2ImpRule, which takes (Equivalence A B) and produces (AND (Imp A B) (Imp B A)). This is an alternative to doing it in the AtomSpaceWrapper (it's more elegant in some ways).
  • Improve the BIT visualization in various ways.
  • Probably thought of a way to make forward chaining 100% general (i.e. to deal with the last remaining case, involving deduction/modus ponens and ForAlls).
  • Updated the PLN usage and PLN Forward Chainer pages. Still need to write about that solution and the adaptive inference control thing.

October

  • Testing out ways to fix the "spurious cloning" bug. Where (if you have multiple FWVars in the (sub)target, PLN makes infinitely many clones of it as results are found. Should be one.) Forward chaining now works much better, and finds dozens of different results.
  • Separating the tests so FC is only run on appropriate ones (i.e. not ones that it simply isn't meant to handle).
  • Fix TableGather/MPunify so it can handle queries with Node Types (as opposed to specific Nodes). Now converting InheritanceLinks to/from SubsetLinks works again, including with SubsetEvalRule (so it can actually produce InheritanceLinks to do deduction on, rather than just use provided ones).
  • Now the only interesting tests that don't run on FC are the FetchDemo ones, possibly due to an issue with forward chaining and ForAlls.
  • Try running backward chaining with a generic target, so it produces everything. (It took literally a minute to implement due to suitable existing code in the FC.) It would solve the ForAlls issue, but is too slow (it tries every path that leads to everything, including vast numbers of paths that don't ground in existing knowledge. Also possibly some more spurious cloning).

November

December

  • Trying to make the IN repository work and getting set up to move to Hong Kong.

2011

January

  • Getting set up in Hong Kong.
  • Fixed the unit tests.
  • Helping Nil with PLN design/implementation decisions
  • Trying to make the Embodiment NLP system work like it once did. Got it to handle "Go to the stick" but not "Go to the soccer ball"
  • Working out with Joel and Zhenhua how to integrate PLN with his implementation of Psi to plan behaviours.

February

  • Finished getting Embodiment (NLP and trick learning) to work.
  • Reading a lot about planning. Rebased Zhenhua's openpsi branch and started improving the planning.

March

  • Using OpenPsi in Multiverse. Tested some motivations. The near/next predicates are quite wrong. Read up all about the Embodiment's Combo framework.
  • Writing a planning document for the planner.
  • Lots of data is recorded about where things are, how they move, their spatial relations etc. The actions are recorded in a less reliable/consistent way.
  • Next step: start using PLN for planning. It seems to work so far, need to make it much more efficient though.
  • Also make a Rule to evaluate Combo expressions when the backward chainer wants to.

April

  • Lots of discussions with Ben, and Joscha Bach (http://cognitive-ai.com).
  • Working out frequent subgraph mining. We'll apply it to spatial and temporal relationships first. Trying out ParMol and the ZGRViewer visualisation system. ZGRViewer might work well once I filter out the Atoms (to make it fast enough). ParMol should be able to work, it's just a bit fiddly...
  • ParMol turned out to be broken, but it was actually abandoned for its sequel ParSeMis (not related to Par-Metis).
  • Worked out a couple of good ways to represent all the spatial relationships as well as events over time.

May

  • Cleaning up Embodiment to record actions, feelings etc in a consistent way.
  • Gephi and Cython seem very useful. I have to write a MindAgent to make (normal) graphs to feed into Parsemis. I'd like to use Joel's new Python bindings for that. And use Gephi to visualise it all.
  • Made a Python framework to export the atomspace as graphs and output them in various formats (using separate, pluggable Python classes). Tried out having a separate class to filter it in various ways useful for frequent graph mining. But that ended up requiring too many special cases. Now using a new approach where it extracts all "trees" from the AtomSpace (basically equivalent to statements in a semantic net).
  • The Gephi visualisation is very good. I'm helping Swaghelper to connect it using the Gephi streaming API, so you could see the AI's knowledge in real-time.
  • Experimented with the SUBDUE graph miner. It worked a lot better than Parsemis/gSpan, and even better after I added the tree extractor. But it now seems like it would be easier to write a simple custom graph miner in Python (rather than deal with embedding Subdue's C code, and it means we can control it better, use less post-processing etc).

June

  • Mostly finished custom graph miner.
  • More embodiment cleanup. There was a system of 'ticks' whereby OpenCog would stop processing messages from the virtual world if it took too long (but causing all sorts of other problems). Also recording spatial relationships better.
  • With Troy, making OpenCog do pathfinding in the blocks world (the idea is that it can run around on blocks and jump or fall).

July/August

  • Many improvements to fishgram. Made a much more efficient search, removed various bugs. It can now also extract cause-and-effect rules involving one or more actions. It calculates the right TruthValue based on the variables involved and the temporal relationships.
  • Improved the Python version of PLN. It can now complete some of the most complex tests in the current PLN suite. (Although it's not actually integrated with the current test system.)
  • Made a nice visualization system for PLN and fishgram (using Gephi).

August-November

  • Much work on Fishgram and Python-PLN. Python PLN is more-or-less ready for use. I added a surprise measure to Fishgram, to make it SUSHYGRAM (SUrprising SubHYperGRAph Mining).