Skip to content

question about brain.py #9

@rewardisenough

Description

@rewardisenough

Hi walker, I don't know if you will see this or not but I have some questions about brain.py.
def dense(X, units, params):
# Reshape the parameters from a flat array to a matrix of weights and biases
reshaped = params.reshape(units, X.shape[1] + 1)
# Apply the weights and biases matrix
return np.dot(X, reshaped[:, :-1].transpose()) + reshaped[:, -1]

For example, if my x data was (700,4) which has 4 features, wouldn't the starting params be (4,) which is a 1d array?
Suppose, I also want 5 output for my neural networks. Then according to your code, reshaped = params.reshape(5,4+1). But this is not possible since you can't reshape an array that's not the same size as the output array(reshaped). 4 is not equal to 25.

Thanks.

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