Skip to main content
. Author manuscript; available in PMC: 2018 Dec 1.
Published in final edited form as: IEEE Trans Knowl Data Eng. 2017 Sep 11;29(12):2744–2757. doi: 10.1109/TKDE.2017.2750669

Algorithm 1.

RAP Learning via Exact Imitation

Input: Λ = Training sequence of sensor event data labeled with activity segments, L = Loss function
Output: Π, the recurrent predictor
1: for each activity predictor j = 1 to K do
2:  Initialize the set of regression examples 𝒟j = ∅
3: end for
4: for each time step i = 1 to N do
5: for each activity predictor j = 1 to K do
6:   Compute Ψlocal(i) = Φ(λi)
7:   Compute Ψcontext(i, j)
8:   Joint features Ψij = Ψlocal(i) ⊕ Ψcontext(i, j)
9:   Compute best output yij using L
10:   Add regression example (Ψij, yij) to 𝒟j
11: end for
12: end for
13: for each activity predictor j = 1 to K do
14:  Πj =Regression-Learner(𝒟j)
15: end for
16: return learned predictor Π = (Π1,Π2,,ΠK)