Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in transition probability computation #2

Open
madsendennis opened this issue Oct 2, 2020 · 0 comments
Open

Error in transition probability computation #2

madsendennis opened this issue Oct 2, 2020 · 0 comments
Assignees

Comments

@madsendennis
Copy link
Collaborator

As highlighted on the scalismo forum (https://groups.google.com/g/scalismo/c/FytrdvlKgk4), there is an error in the current computation of the transition probability. The parameter update proposal is not correctly projected into the posterior model.

Current version:

override def logTransitionProbability(from: ModelFittingParameters, to: ModelFittingParameters): Double = {
  val posterior = cashedPosterior(from)
  val compensatedTo = to.copy(shapeParameters = ShapeParameters(from.shapeParameters.parameters + (to.shapeParameters.parameters - from.shapeParameters.parameters) / stepLength))
  posterior.logpdf(compensatedTo.shapeParameters.parameters)
  }

example of correct projection:

override def logTransitionProbability(from: ModelFittingParameters, to: ModelFittingParameters): Double = {
  val pos = cashedPosterior(from)
  val posterior = StatisticalMeshModel(referenceMesh, pos)

  val compensatedTo = from.shapeParameters.parameters + ((to.shapeParameters.parameters - 
  from.shapeParameters.parameters) / stepLength)
  val toMesh = model.instance(compensatedTo)

  val projectedTo = posterior.coefficients(toMesh)
  pos.logpdf(projectedTo)
}

Testing needs to be performed before included in the project.

@madsendennis madsendennis self-assigned this Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant