Skip to content

[EXTERNAL] docs(keras2): use categorical_crossentropy for single-label multi-class#3048

Merged
EldritchGriffin merged 6 commits into01-edu:masterfrom
vpollo11:fix-multi-class-loss
Aug 31, 2025
Merged

[EXTERNAL] docs(keras2): use categorical_crossentropy for single-label multi-class#3048
EldritchGriffin merged 6 commits into01-edu:masterfrom
vpollo11:fix-multi-class-loss

Conversation

@vpollo11
Copy link
Copy Markdown
Member

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.

…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`.
@vpollo11 vpollo11 changed the title docs(keras2): use categorical_crossentropy for single-label multi-class [EXTERNAL] docs(keras2): use categorical_crossentropy for single-label multi-class Aug 26, 2025
Copy link
Copy Markdown
Member

@EldritchGriffin EldritchGriffin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EldritchGriffin EldritchGriffin self-assigned this Aug 28, 2025
@EldritchGriffin EldritchGriffin added the 🗂️ docs Documentation label Aug 28, 2025
@EldritchGriffin
Copy link
Copy Markdown
Member

Formatting required.

@EldritchGriffin EldritchGriffin merged commit 977e708 into 01-edu:master Aug 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗂️ docs Documentation 🤸 skip-check-links Skip check links

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants