Skip to content

Dot products (Linear Algebra for Machine Learning) #16

@vasilygrz

Description

@vasilygrz

Hi Jon,

Thank you for creating these courses. I'm currently doing the first one, Linear Algebra for Machine Learning.

In 3.4 The Dot Product, you said the following:

  1. (...) a lot of the PyTorch operations (...) don't work on integer-typed PyTorch tensors.

    I've found this open issue in PyTorch issue where they mention that torch.dot can be calculated with tensors of integer type on a CPU, but not on a GPU. The issue is that you can't use integers to calculate gradients, like you said.

    I'd like to propose adding a comment here to put this information into context:

    "torch.dot(torch.tensor([25, 2, 5.]), torch.tensor([0, 1, 2.]))"

  2. (...) in TensorFlow, as far as am aware, there's a not a built-in dot product method.

    I've searched and found the tf.tensordot function. It can be calculated as:

    tf.tensordot(x_tf, y_tf, axes=1)
    

    Similarly, I'd like to propose adding the command below the existing one with a comment:

    "tf.reduce_sum(tf.multiply(x_tf, y_tf))"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions