ArticleslgStudy

computer science

Constructing skill trees

Constructing skill trees is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Constructing skill trees rather than just read about it. In short: Constructing skill trees (CST) is a hierarchical reinforcement learning algorithm which can build skill trees from a set of sample solution trajectories obtained from demonstration. CST uses an incremental MAP (maximum a posteriori) change point detection algorithm to segment each demonstration trajectory into skills and integrate the results into a skill tree.

Key takeaways

  • Constructing skill trees belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Constructing skill trees to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Constructing skill trees from memory before moving on to harder problems.

Reference excerpt

Constructing skill trees (CST) is a hierarchical reinforcement learning algorithm which can build skill trees from a set of sample solution trajectories obtained from demonstration. CST uses an incremental MAP (maximum a posteriori) change point detection algorithm to segment each demonstration trajectory into skills and integrate the results into a skill tree. CST was introduced by George Konidaris, Scott Kuindersma, Andrew Barto and Roderic Grupen in 2010.

Algorithm CST consists of mainly three parts;change point detection, alignment and merging. The main focus of CST is online change-point detection. The change-point detection algorithm is used to segment data into skills and uses the sum of discounted reward Rt as the target regression variable. Each skill is assigned an appropriate abstraction. A particle filter is used to control the computational complexity of CST. The change point detection algorithm is implemented as follows. The data for times t∈T and models Q with prior p(q∈Q) are given. The algorithm is assumed to be able to fit a segment from time j+1 to t using model q with the fit probability P(j,t,q). A linear regression model with Gaussian noise is used to compute P(j,t,q). The Gaussian noise prior has mean zero, and variance which follows InverseGamma(v2,u2). The prior for each weight follows Normal(0,σ2δ). The fit probability P(j,t,q) is computed by the following equation.

P(j,t,q)=π−n2δm|(A+D)−1|12uv2(y+u)u+v2Γ(n+v2)Γ(v2) Then, CST compute the probability of the changepoint at time j with model q, Pt(j,q) and PjMAP using a Viterbi algorithm.

Pt(j,q)=(1−G(t−j−1))P(j,t,q)p(q)PjMAP PjMAP=maxi,qPj(i,q)g(j−i)1−G(j−i−1),∀j<t The descriptions of the parameters and variables are as follows;

A=∑i=jtΦ(xi)Φ(xi)T Φ(xi): a vector of m basis functions evaluated at state xi y=(∑i=jtRi2)−bT(A+D)−1b b=∑i=jtRiΦ(xi) Ri=∑j=iTγj−irj 𝛾: Gamma function n=t−j m: The number of basis functions q has. D: an m by m matrix with δ−1 on the diagonal and zeros elsewhere The skill length l is assumed to follow a Geometric distribution with parameter p

g(l)=(1−p)l−1p G(l)=(1−(1−p)l) p=1k k: Expected skill length Using the method above, CST can segment data into a skill chain. The time complexity of the change point detection is O(NL) and storage size is O(Nc), where N is the number of particles, L is the time of computing P(j,t,q), and there are O(c) change points. Next step is alignment. CST needs to align the component skills because the change-point does not occur in the exactly same places. Thus, when segmenting second trajectory after segmenting the first trajectory, it has a bias on the location of change point in the second trajectory. This bias follows a mixture of gaussians. The last step is merging. CST merges skill chains into a skill tree. CST merges a pair of trajectory segments by allocating the same skill. All trajectories have the same goal and it merges two chains by starting at their final segments. If two segments are statistically similar, it merges them. This procedure is repeated until it fails to merge a pair of skill segments. P(j,t,q) are used to determine whether a pair of trajectories are modeled better as one skill or as two different skills.

Pseudocode The following pseudocode describes the change point detection algorithm:

particles := []; Process each incoming data point for t = 1:T do //Compute fit probabilities for all particles for p ∈ particles do p_tjq := (1 − G(t − p.pos − 1)) × p.fit_prob × model_prior(p.model) × p.prev_MAP p.MAP := p_tjq × g(t−p.pos) / (1 − G(t − p.pos − 1)) end // Filter if necessary if the number of particles ≥ N then particles := particle_filter(p.MAP, M) end // Determine the Viterbi path for t = 1 do max_path := [] max_MAP := 1/|Q| else max_particle := maxp p.MAP max_path := max_particle.path ∪ max_particle max_MAP := max_particle.MAP end // Create new particles for a changepoint at time t for q ∈ Q do new_p := create_particle(model=q, pos=t, prev_MAP=max_MAP, path=max_path) p := p ∪ new_p end // Update all particles for p ∈ P do particles := update_particle(current_state, current_reward, p) end end // Return the most likely path to the final point return max_path

function update_particle(current_state, current_reward, particle) is p := particle r_t := current_reward // Initialization if t = 0 then p.A := zero matrix(p.m, p.m) p.b := zero vector(p.m) p.z := zero vector(p.m) p.sum r := 0 p.tr1 := 0 p.tr2 := 0 end if // Compute the basis function vector for the current state Φt := p.Φ (current state) // Update sufficient statistics p.A := p.A + ΦtΦTt p.z := 𝛾p.z + Φt p.b := p.b + rt p.z p.tr1 := 1 + 𝛾2 p.tr1 p.sum r := sum p.r + r2t p.tr1 + 2𝛾rt p.tr2 p.tr2 := 𝛾p.tr2 + rt p.tr1 p.fit_prob := compute_fit_prob(p, v, u, delta, 𝛾)

Assumptions CTS assume that the demonstrated skills form a tree, the domain reward function is known and the best model for merging a pair of skills is the model selected for representing both individually.

Advantages CST is much faster learning algorithm than skill chaining. CST can be applied to learning higher dimensional policies. Even unsuccessful episode can improve skills. Skills acquired using agent-centric features can be used for other problems.

Uses CST has been used to acquire skills from human demonstration in the PinBall domain. It has been also used to acquire skills from human demonstration on a mobile manipulator.

See also Prefrontal cortex basal ganglia working memory State–action–reward–state–action Sammon Mapping

References

Konidaris, George; Scott Kuindersma; Andrew Barto; Roderic Grupen (2010). "Constructing Skill Trees for Reinforcement Learning Agents from Demonstration Trajectories". Advances in Neural Information Processing Systems 23. Konidaris, George; Andrew Barto (2009). "Skill discovery in continuous reinforcement learning domains using skill chaining". Advances in Neural Information Processing Systems 22. Fearnhead, Paul; Zhen Liu (2007). "On-line Inference for Multiple Change Points". Journal of the Royal Statistical Society.

Worked examples

Example 1 — a first encounter with Constructing skill trees

Start with the simplest possible case. Write down what Constructing skill trees claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Constructing skill trees before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Constructing skill trees ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Constructing skill trees

In research
Constructing skill trees appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Constructing skill trees in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Constructing skill trees is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2010 in artificial intelligence, Machine learning algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Constructing skill trees outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Constructing skill trees” →

How to study Constructing skill trees in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Constructing skill trees means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Constructing skill trees out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Constructing skill trees in simple terms?

Constructing skill trees (CST) is a hierarchical reinforcement learning algorithm which can build skill trees from a set of sample solution trajectories obtained from demonstration. CST uses an incremental MAP (maximum a posteriori) change point detection algorithm to segment each demonstration tra…

Why does Constructing skill trees matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Constructing skill trees?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Constructing skill trees.

Tags

  • 2010 in artificial intelligence
  • Machine learning algorithms

Keep exploring