view tvii/dot.py @ 93:36c141f0f0bd default tip

add tensorflow dependency + console scripts
author Jeff Hammel <k0scist@gmail.com>
date Sun, 17 Dec 2017 14:31:35 -0800
parents bb8b6b06ca83
children
line wrap: on
line source

"""
dot product
"""

def dot(w, x):
    """inner dot product"""
    assert len(w) == len(x)
    return sum([a*b for a, b in zip(w,x)])