Skip to content

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
neka-nat committed Apr 24, 2023
1 parent 6656296 commit 7614b08
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
11 changes: 10 additions & 1 deletion probreg/bcpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@

EstepResult = namedtuple("EstepResult", ["nu_d", "nu", "n_p", "px", "x_hat"])
MstepResult = namedtuple("MstepResult", ["transformation", "u_hat", "sigma_mat", "alpha", "sigma2"])
MstepResult.__doc__ = """Result of Maximization step.
Attributes:
transformation (tf.Transformation): Transformation from source to target.
u_hat (numpy.ndarray): A parameter used in next Estep.
sigma_mat (numpy.ndarray): A parameter used in next Estep.
alpha (float): A parameter used in next Estep.
sigma2 (float): Variance of Gaussian distribution.
"""


@six.add_metaclass(abc.ABCMeta)
Expand Down Expand Up @@ -132,7 +141,7 @@ def _maximization_step(source, target, rigid_trans, estep_res, gmat_inv, lmd, k,
u_hm = u_hat - u_m
s_xu = np.matmul(np.multiply(nu, (x_hat - x_m).T), u_hm) / n_p
s_uu = np.matmul(np.multiply(nu, u_hm.T), u_hm) / n_p + sigma2_m * np.identity(dim)
phi, s_xu_d, psih = np.linalg.svd(s_xu, full_matrices=True)
phi, _, psih = np.linalg.svd(s_xu, full_matrices=True)
c = np.ones(dim)
c[-1] = np.linalg.det(np.dot(phi, psih))
rot = np.matmul(phi * c, psih)
Expand Down
7 changes: 7 additions & 0 deletions probreg/cpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@

EstepResult = namedtuple("EstepResult", ["pt1", "p1", "px", "n_p"])
MstepResult = namedtuple("MstepResult", ["transformation", "sigma2", "q"])
MstepResult.__doc__ = """Result of Maximization step.
Attributes:
transformation (tf.Transformation): Transformation from source to target.
sigma2 (float): Variance of Gaussian distribution.
q (float): Result of likelihood.
"""


@six.add_metaclass(abc.ABCMeta)
Expand Down
7 changes: 7 additions & 0 deletions probreg/filterreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@

EstepResult = namedtuple("EstepResult", ["m0", "m1", "m2", "nx"])
MstepResult = namedtuple("MstepResult", ["transformation", "sigma2", "q"])
MstepResult.__doc__ = """Result of Maximization step.
Attributes:
transformation (tf.Transformation): Transformation from source to target.
sigma2 (float): Variance of Gaussian distribution.
q (float): Result of likelihood.
"""


def dualquat_from_twist(tw):
Expand Down
6 changes: 6 additions & 0 deletions probreg/gmmtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

EstepResult = namedtuple("EstepResult", ["moments"])
MstepResult = namedtuple("MstepResult", ["transformation", "q"])
MstepResult.__doc__ = """Result of Maximization step.
Attributes:
transformation (tf.Transformation): Transformation from source to target.
q (float): Result of likelihood.
"""


class GMMTree:
Expand Down

0 comments on commit 7614b08

Please sign in to comment.