Hi,I'm Michela and I'm working with ScalismoLab on a set of sockets.
I have some problems on creating the model. I would like to create a model that have higher deformations on the apex and on the posterior area of the socket.
I suppose that I need to use the changepoint Kernel but I don't know which matrices give in input to the function and how to modify this code in order to modify the deformation field only in the regions of interest.
I have used this code:
val zeroMean = VectorField(RealSpace[_3D], (pt:Point[_3D]) => Vector(0,0,0))
val kernelXYDirection = GaussianKernel[_3D](200) * 80 + GaussianKernel[_3D](100) * 20
val kernelZDirection = GaussianKernel[_3D](800) * 800 + GaussianKernel[_3D](400) * 1600
val matrixVauedGaussian = DiagonalKernel(kernelXYDirection, kernelXYDirection, kernelZDirection)
case class LinearKernel() extends PDKernel[_3D] {
override def domain = RealSpace[_3D]
override def k(x: Point[_3D], y: Point[_3D]) = {
x.toVector dot y.toVector
}
}
val linearPDKernel = new LinearKernel() * 0.01
val simLinear=DiagonalKernel(linearPDKernel)
case class ChangePointKernel(ker1 :MatrixValuedPDKernel[_3D, _3D], ker2 :MatrixValuedPDKernel[_3D, _3D]) extends MatrixValuedPDKernel[_3D, _3D] {
def s(p: Point[_3D]) = 1f / (1f + math.exp(-p(0)))
def k(x: Point[_3D], y: Point[_3D]) = {
val sx = s(x)
val sy = s(y)
ker1(x,y) * sx * sy + ker2(x,y) * (1-sx) * (1-sy)
}
override def domain = RealSpace[_3D]
}
val chgptKer = ChangePointKernel(matrixVauedGaussian, simLinear)
//I build GP
val gp : GaussianProcess[_3D, _3D] = GaussianProcess(zeroMean, chgptKer)
I have tryed other type of kernels but I don't obtain a good fit when I fit the model created with the target.
Do you have some ideas for building the model?
Best regards
Michela