TorchedUp
LearnBetaProblemsSystem DesignSoonPremium
TorchedUp
LearnBetaProblemsSystem DesignSoonPremium
←

129. Detect Dead Network

Medium

A cross-entropy classifier that has not learned anything outputs a uniform distribution, giving loss log(K) where K is the number of classes. Detect this state.

Signature: def is_dead_network(loss_history: list, num_classes: int, tol: float = 0.05) -> bool

Return True if the mean of the last N = min(20, len(loss_history)) losses is within tol of log(num_classes) (in absolute value).

Math

dead⟺​Lrecent​−logK​≤tol

Asked at

NumPy

import numpy as np

 

def is_dead_network(...):

    pass

🔒

Premium problem

Free accounts include problems #1–20. Upgrade to unlock the editor, hidden test cases, and reference solutions for every problem.

Upgrade to PremiumBack to problems

Already premium?