Blog

Home / Blog
JS : Splitting an array into batches

JS : Splitting an array into batches

Work
In order to meet the limits on a REST API call, I needed to split a batch of record IDs into batches the size of the call's limit.  Since I was doing this in NodeJS, I worked it out functionally with the .reduce() method.  [The reduce() method applies a function against an accumulator and each value of the array (from left-to-right) to reduce it to a single value.]  In this case, my single value target was an array of arrays. There trick here was use a little index magic and pass in an array of empty arrays as the initial value parameter where the number of empty arrays equaled the desired number of batches. The effect is that 1, 3, 5, and 7 go into the first batch and 2, 4, 6, and 8 go into the…
Read More

Dissertation update – October 2015

Dissertation, Updates
Quick review: I have a working version of a relational auto-encoder and have used it to learn a transfer function between two reinforcement learning tasks.  As has been done in other research, I've used state-action-state triplets as the training data.  My hypothesis is that a relational auto-encoder will build a common feature space for the transition dynamics between the two different reinforcement learning domains. There are two problems that I'm trying to solve.  Both deal with the learning algorithm for the interdomain mapping function.   The first addresses how the data enters training and the second is in the characteristics of the data once run through the trained model. Dealing with uncorrelated data Currently, the relational auto-encoder learns on pairs of triplets presented together by using standard back-propagation.  This approach could have…
Read More

Two-stage Learning Step for Backpropagation in a Relational Autoencoder

General
Working on gradient descent / backpropagation for a relational autoencoder.   I'm not really sure this is needed yet, so I have to build the testing framework for it all.  Separately I'm implementing a RL agent that uses Least Squares Policy Iteration to learn. Let X and Y be two sets of training examples of sizes N and M respectively Select $latex x \in X $ and $latex y \in Y $ randomly Feed $latex (x,y)$ forward Step 1 - Train X Hold w and x constant and minimize cost by treating y' as a parameter Calculate error on x side of cost function Backprop error Update W (and b) only on the X side Step 2 - Train Y Hold w and y constant and minimize cost by treating x' as a…
Read More
Preview Problem – Share the beer

Preview Problem – Share the beer

General
Recently, I shared a problem on Facebook.  It's typically called the "sharing wine" problem, but my friend, Cyrus, thought it'd be better with beer.  I agree, so I've modified these slightly. It went something like this: We have three containers of different sizes, 30L / 11L / 7L.  The 30L is filled with beer.  Empty exactly half of the 30L using only the 11L and 7L containers. I'll introduce some notation here so that we can talk about the answer.  Let's say that we create a triple (a, b, c) indicating the amount of beer in each container at any one time.  Say that we order these largest to smallest for convenience.  Let a = the 30L container, b = the 11L container, c = the 7L container. So, starting out we have (30,0,0).  Cyrus…
Read More

Analogy is a core concept in cognition

Dissertation, notes, Research
We begin with a couple of simple queries about familiar phenomena: “Why do babies not remember events that happen to them?” and “Why does each new year seem to pass faster than the one before?” I wouldn’t swear that I have the final answer to either one of these queries, but I do have a hunch, and I will here speculate on the basis of that hunch. And thus: the answer to both is basically the same, I would argue, and it has to do with the relentless, lifelong process of chunking — taking “small” concepts and putting them together into bigger and bigger ones, thus recursively building up a giant repertoire of concepts in the mind. How, then, might chunking provide the clue to these riddles? Well, babies’ concepts…
Read More
C2FO/nools – A rete-based rules engine for Node

C2FO/nools – A rete-based rules engine for Node

General
I was reminiscing over the rules-based interaction system I worked with on the Zeno robot back in the day.  Particularly, I was thinking about how how the deterministic, one-shot state transition sometimes led to some undesirable and aberrant behavior.  If you weren't careful, the Personality could slam back and forth between different "mental" states and even seem somewhat ADD.  Even though that behavior was mitigated by writing soft transition language into the resulting state's verbal actions, the Personality sometimes seemed to have no sense of attention or immediate auto-biography. So, today I was thinking about a state-transition system where the transition actions were less one-shot.  My thinking goes like this: Mental states prime us towards the following mental behavior: accentuate thinking about some things suppress thinking about other things thinking about things in a certain way…
Read More

I hate Verdana too

General
Typography can be fun and zany, but there's always a purpose behind it.  Often, you select fonts for readability.  On the web, the challenge is even bigger because the delivery is often so variable with differently sized screens ranging from huge monitors to small mobile devices. So, for most applications, you need a font that helps the eyes grasp what they are seeing.  Verdana is just not one of those.  In fact, it leans towards making reading difficult.  This article, by Pamela Wilson, explains some of the problems and has a good set of examples. Go see the article here : Why I Hate Verdana - Big Brand System -.
Read More
The Ultimate Software Development Office Layout

The Ultimate Software Development Office Layout

General
This is a pretty decent article on office layouts for software development. I would make a few adjustments. These are based on my own observations and experience. Your mileage may vary. 1) War rooms are good for rapid product development -> driving to version 1.0 quickly. They are less productive for long-term software development, or for multiple project development. 7) Emphasize #7. 8) In fact, people should move to the space most conducive to the type of work they are doing at that time. 11) With Agile development, you should be able to break teams into no more than 4 people each.  I can't imagine a room with 12 people working in it. Add #23) A project status board should be placed conspicuously.  It's best if this is electronic and automatically updated.…
Read More

Fatal error: Call to undefined function the_posts_pagination() in /home/timdockins/public_html/wp-content/themes/total/index.php on line 44