Skip to content

Instantly share code, notes, and snippets.

@bayerj
Created May 11, 2012 16:08
Show Gist options
  • Select an option

  • Save bayerj/2660672 to your computer and use it in GitHub Desktop.

Select an option

Save bayerj/2660672 to your computer and use it in GitHub Desktop.
X = predicted position
Z = true position
lds = our learned lds on [X, Z]
# Get marginal LDS
marginal_lds = marginal(lds, (7, 8, 9, 10, 11, 12, 13)) #
# Compile a function to calculate hidden state given position predictions.
f = marginal_lds.function(['inpt'], ['filtered_means'])
# Calculate hidden means
h = f(Z)
# Infer true positions from hiddens.
hidden_to_pos = lds.parameters['emission'][:, (0, 1, 2, 3, 4, 5, 6)]
p = np.dot(h, hidden_to_pos)
# plot p and Z.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment