deepr.layers.DotProduct

class deepr.layers.DotProduct(n_in=2, **kwargs)[source]

Dot Product on the last dimension of the input vectors.

It will add missing dimensions to the before last dimension. For example, if

  • t1: shape = [batch, num_target, 100]

  • t2: shape = [batch, 100]

It will return

  • t: shape = [batch, num_target], where

    t[i, j] = sum_k(t1[i, k] * t2[i, j, k])

__init__(n_in=2, **kwargs)[source]

Methods

__init__([n_in])

forward(tensors[, mode])

Forward method of the layer

forward_as_dict(tensors[, mode])

Forward method on a dictionary of Tensors.