1
$\begingroup$

In Andrew Ng's deep learning course on Coursera, how is a single scalar value obtained from a flattened image (feature vector)? First there is $w.T$ of shape $(1, n_X)$ which is multiplied by $X$ of shape $(n_X, 400)$, so by the laws of linear algebra, the remaining vector is of shape $(1, 400)$. This is then passed through Sigmoid to form vector A, and the shape remains at $(1, 400)$. How is this vector then converted to a binary scalar value ($0$ or $1$) for prediction $y$-hat?

$\endgroup$
2
  • $\begingroup$ Do you mean how to convert a probability to a binary value? (Sigmoid tends to be used on the final layer to give probabilities.) $\endgroup$ – Dave Jul 4 '20 at 22:13
  • $\begingroup$ Please add link of the video, or put an Image $\endgroup$ – 10xAI Jul 5 '20 at 11:23
1
$\begingroup$

$n_X$ is the number of feature, $400$ is the number of data.

Each of the entry of $A$ is the output of the sigmoid layer, it is between $0$ and $1$. We can then decide a threshold (typically $0.5$) such that if it is at least the threshold, we map it to $1$, otherwise, we map it to $0$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.