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 ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Module « numpy.matlib »

Fonction vecmat - module numpy.matlib

Signature de la fonction vecmat

def vecmat(*args, **kwargs) 

Description

help(numpy.matlib.vecmat)

vecmat(x1, x2, /, out=None, *, casting='same_kind', order='K', dtype=None, subok=True[, signature, axes, axis])

Vector-matrix dot product of two arrays.

Given a vector (or stack of vector) :math:`\mathbf{v}` in ``x1`` and
a matrix (or stack of matrices) :math:`\mathbf{A}` in ``x2``, the
vector-matrix product is defined as:

.. math::
   \mathbf{b} \cdot \mathbf{A} = \sum_{i=0}^{n-1} \overline{v_i}A_{ij}

where the sum is over the last dimension of ``x1`` and the one-but-last
dimensions in ``x2`` (unless `axes` is specified) and where
:math:`\overline{v_i}` denotes the complex conjugate if :math:`v`
is complex and the identity otherwise. (For a non-conjugated vector-matrix
product, use ``np.matvec(x2.mT, x1)``.)

.. versionadded:: 2.2.0

Parameters
----------
x1, x2 : array_like
    Input arrays, scalars not allowed.
out : ndarray, optional
    A location into which the result is stored. If provided, it must have
    the broadcasted shape of ``x1`` and ``x2`` with the summation axis
    removed. If not provided or None, a freshly-allocated array is used.
**kwargs
    For other keyword-only arguments, see the
    :ref:`ufunc docs <ufuncs.kwargs>`.

Returns
-------
y : ndarray
    The vector-matrix product of the inputs.

Raises
------
ValueError
    If the last dimensions of ``x1`` and the one-but-last dimension of
    ``x2`` are not the same size.

    If a scalar value is passed in.

See Also
--------
vecdot : Vector-vector product.
matvec : Matrix-vector product.
matmul : Matrix-matrix product.
einsum : Einstein summation convention.

Examples
--------
Project a vector along X and Y.

>>> v = np.array([0., 4., 2.])
>>> a = np.array([[1., 0., 0.],
...               [0., 1., 0.],
...               [0., 0., 0.]])
>>> np.vecmat(v, a)
array([ 0.,  4., 0.])


Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé