Coder Social home page Coder Social logo

Comments (1)

FanwangM avatar FanwangM commented on August 22, 2024

This is a very nice point!

We also have an error() function in

def error(array_a, array_b, array_u, array_v=None):
r"""
Return the single- or double- sided Procrustes/norm-squared error.
The single sided error is defined as
.. math::
\text{Tr}\left[\left(\mathbf{AU} - \mathbf{B}\right)^\dagger
\left(\mathbf{AU} - \mathbf{B}\right)\right]
The double sided Procrustes error is defined as
.. math::
\text{Tr}\left[
\left(\mathbf{U}_1^\dagger \mathbf{A}\mathbf{U}_2 - \mathbf{B}\right)^\dagger
\left(\mathbf{U}_1^\dagger \mathbf{A}\mathbf{U}_2 - \mathbf{B}\right)\right]
Parameters
----------
array_a : npdarray
The 2D array :math:`A` being transformed.
array_b : npdarray
The 2D reference array :math:`B`.
array_u : ndarray
The 2D array representing the transformation :math:`\mathbf{U}`.
array_v : ndarray, optional
The 2D array representing the transformation :math:`\mathbf{V}`. If provided, it will
compute the double-sided Procrustes error. Otherwise, will compute the single-sided
Procrustes error.
Returns
-------
error : float
The squared value of the distance between transformed array and reference.
"""
array_e = np.dot(array_a, array_u) if array_v is None \
else np.dot(np.dot(array_u.T, array_a), array_v)
array_e -= array_b
return np.trace(np.dot(array_e.T, array_e))
.

To avoid ambiguity, can we name e_opt as distance? Or we can rename error() function as compute_error().
@FarnazH Thanks.

from procrustes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.