Skip to content

Instantly share code, notes, and snippets.

def mi_linear(arg1, arg2, output_size, global_bias_start=0.0, scope=None):
"""Multiplicated Integrated Linear map:
See http://arxiv.org/pdf/1606.06630v1.pdf
A * (W[0] * arg1) * (W[1] * arg2) + (W[0] * arg1 * bias1) + (W[1] * arg2 * bias2) + global_bias.
Args:
arg1: batch x n, Tensor.
arg2: batch x n, Tensor.
output_size: int, second dimension of W[i].
global_bias_start: starting value to initialize the global bias; 0 by default.
scope: VariableScope for the created subgraph; defaults to "MILinear".