Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé
Module « scipy.linalg »

Fonction khatri_rao - module scipy.linalg

Signature de la fonction khatri_rao

def khatri_rao(a, b) 

Description

help(scipy.linalg.khatri_rao)

Khatri-rao product

A column-wise Kronecker product of two matrices

Parameters
----------
a : (n, k) array_like
    Input array
b : (m, k) array_like
    Input array

Returns
-------
c:  (n*m, k) ndarray
    Khatri-rao product of `a` and `b`.

Notes
-----
The mathematical definition of the Khatri-Rao product is:

.. math::

    (A_{ij}  \bigotimes B_{ij})_{ij}

which is the Kronecker product of every column of A and B, e.g.::

    c = np.vstack([np.kron(a[:, k], b[:, k]) for k in range(b.shape[1])]).T

Examples
--------
>>> import numpy as np
>>> from scipy import linalg
>>> a = np.array([[1, 2, 3], [4, 5, 6]])
>>> b = np.array([[3, 4, 5], [6, 7, 8], [2, 3, 9]])
>>> linalg.khatri_rao(a, b)
array([[ 3,  8, 15],
       [ 6, 14, 24],
       [ 2,  6, 27],
       [12, 20, 30],
       [24, 35, 48],
       [ 8, 15, 54]])



Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé