[EXTERNAL] docs(keras2): use categorical_crossentropy for single-label multi-class#3048
Merged
EldritchGriffin merged 6 commits into01-edu:masterfrom Aug 31, 2025
Merged
Conversation
…ng data ### Fix ambiguous instruction about row indexing #### What changed The sentence: > "Load the data using genfromtxt, specifying the delimiter as ';', and optimize the numpy array size by reducing the data types. Use np.float32 and verify that the resulting numpy array weighs 76800 bytes." was unclear about whether the CSV header should be skipped or not. It now says: > "Load the data using genfromtxt, specifying the delimiter as ';' with excluding the headers, and optimize the numpy array size by reducing the data types. Use np.float32 and verify that the resulting numpy array weighs 76800 bytes." #### Why Later instructions refer to specific row numbers (like the 2nd, 7th, and 12th rows). Without stating whether the header counts as a row, the meaning is ambiguous — it affects the indexing. This fix makes it clear that the header should be excluded. #### No code changes This is a documentation fix only.
[EXTERNAL] fix(numpy): clarify that CSV header is excluded when loading data
…ss in Exercise 4 ## Summary Docs-only fix in **Keras 2 → Exercise 4 (Multi-class classification – Optimize)**: Replace the incorrect mention of `binary_crossentropy` with the correct `categorical_crossentropy` for **single-label multi-class** classification. ## Why `binary_crossentropy` is intended for **binary** or **multi-label** tasks. For **single-label multi-class** with a softmax output, the appropriate loss is **`categorical_crossentropy`**. This correction prevents learner confusion and aligns the subject with standard Keras practice. ## Scope of Change * **Updated text** in Exercise 4 to say `categorical_crossentropy` instead of `binary_crossentropy`.
Member
|
Formatting required. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docs-only fix in Keras 2 → Exercise 4 (Multi-class classification – Optimize):
Replace the incorrect mention of
binary_crossentropywith the correctcategorical_crossentropyfor single-label multi-class classification.Why
binary_crossentropyis intended for binary or multi-label tasks.For single-label multi-class with a softmax output, the appropriate loss is
categorical_crossentropy. This correction prevents learner confusion and aligns the subject with standard Keras practice.Scope of Change
categorical_crossentropyinstead ofbinary_crossentropy.