Skip to content

Getting Started example confusion #101

@chipbuster

Description

@chipbuster

Hey all. This was brought to my attention by this SO question, and I'm not 100% convinced that I'm right about what happens here, so please bear with me.

It looks like what the example on "Getting Started" wants to do is define a linear model from R^5 onto R^2, and then train that with a single example (x, y), where x is in R^5 and y is in R^2.

However, when we do the line data = zip(x,y), we generate a length-2 iterator containing [(x[1], y[1]), (x[2], y[2])] and ignore the other 3 elements of x. This is then fed into the loss function, which is still capable of computing an answer because of the elementwise operations. So what we actually end up doing is training a function from R^1 to R^1, with two examples.

I can replace x = rand(5) with x =vcat(rand(2), [missing, missing, missing]) and the whole tutorial still runs without a hitch, which seems to confirm that the last three elements of x are never examined.

Is this intended behavior, or was the line intended to be something like data = zip(eachcol(x), eachcol(y))?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions