Skip to content

Bug Report for gradient-descent #5769

@oojBuffalo

Description

@oojBuffalo

Bug Report for https://neetcode.io/problems/gradient-descent

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.


Albeit a very minor detail, the problem description and function signature do not appear to be consistent with Test Case 1.

For reference, Test Case 1 (same as Example 1):

Input:
iterations = 0, learning_rate = 0.01, init = 5

Output:
5

The problem description states:

Use Python's round() function to round the output to 5 decimal places.

The function signature is:

def get_minimizer(self, iterations: int, learning_rate: float, init: int) -> float

Granted there are no iterations occurring, and the initial value ought to remain unchanged, it seems like bad practice to have the function return an integer value, when the problem description and type hints indicate a float should be returned.

Image

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