Skip to content

Adding LSTM algorithm from scratch in neural network algorithm sections - #12082

Open
LEVIII007 wants to merge 28 commits into
TheAlgorithms:masterfrom
LEVIII007:lstm
Open

Adding LSTM algorithm from scratch in neural network algorithm sections#12082
LEVIII007 wants to merge 28 commits into
TheAlgorithms:masterfrom
LEVIII007:lstm

Conversation

@LEVIII007

Copy link
Copy Markdown

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py Outdated
##### Testing #####
# lstm.test()

# testing can be done by uncommenting the above lines of code. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

An error occurred while parsing the file: neural_network/lstm.py

Traceback (most recent call last):
  File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 146, in parse
    reports = lint_file(
              ^^^^^^^^^^
libcst._exceptions.ParserSyntaxError: Syntax Error @ 317:1.
parser error: error at 317:62: expected INDENT

# testing can be done by uncommenting the above lines of code.
^

@algorithms-keeper algorithms-keeper Bot added the awaiting reviews This PR is ready to be reviewed label Oct 15, 2024
@algorithms-keeper algorithms-keeper Bot added the tests are failing Do not merge until tests pass label Oct 15, 2024
@algorithms-keeper algorithms-keeper Bot added require descriptive names This PR needs descriptive function and/or variable names require tests Tests [doctest/unittest/pytest] are required labels Oct 15, 2024

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py Outdated
self.char_to_idx = {c: i for i, c in enumerate(self.chars)}
self.idx_to_char = {i: c for i, c in enumerate(self.chars)}

self.train_X, self.train_y = self.data[:-1], self.data[1:]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: train_X

Comment thread neural_network/lstm.py
self.initialize_weights()

##### Helper Functions #####
def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_idx[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py
self.wy = self.init_weights(self.hidden_dim, self.char_size)
self.by = np.zeros((self.char_size, 1))

def init_weights(self, input_dim: int, output_dim: int) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
np.sqrt(6 / (input_dim + output_dim))

##### Activation Functions #####
def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
self.input_gates = {}
self.outputs = {}

def forward(self, inputs: list) -> list:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward

Comment thread neural_network/lstm.py Outdated

return outputs

def backward(self, errors: list, inputs: list) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward

Comment thread neural_network/lstm.py
[d_bf, d_bi, d_bc, d_bo, d_by]):
param -= self.lr * grad

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated
# Backward pass and weight updates
self.backward(errors, inputs)

def predict(self, inputs: list) -> str:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function predict

Comment thread neural_network/lstm.py Outdated
output = self.forward(inputs)[-1]
return self.idx_to_char[np.argmax(self.softmax(output))]

def test(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot removed require descriptive names This PR needs descriptive function and/or variable names require tests Tests [doctest/unittest/pytest] are required labels Oct 15, 2024

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py Outdated
# lstm.train()

# # Test the LSTM network and compute accuracy
# lstm.test()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

An error occurred while parsing the file: neural_network/lstm.py

Traceback (most recent call last):
  File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 146, in parse
    reports = lint_file(
              ^^^^^^^^^^
libcst._exceptions.ParserSyntaxError: Syntax Error @ 358:1.
parser error: error at 359:0: expected INDENT

    # lstm.test()
^

@algorithms-keeper algorithms-keeper Bot added require descriptive names This PR needs descriptive function and/or variable names require tests Tests [doctest/unittest/pytest] are required labels Oct 15, 2024

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py Outdated
self.char_to_idx = {c: i for i, c in enumerate(self.chars)}
self.idx_to_char = {i: c for i, c in enumerate(self.chars)}

self.train_X, self.train_y = self.data[:-1], self.data[1:]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: train_X

Comment thread neural_network/lstm.py
self.initialize_weights()

##### Helper Functions #####
def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_idx[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py
self.wy = self.init_weights(self.hidden_dim, self.char_size)
self.by = np.zeros((self.char_size, 1))

def init_weights(self, input_dim: int, output_dim: int) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
)

##### Activation Functions #####
def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
self.input_gates = {}
self.outputs = {}

def forward(self, inputs: list) -> list:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward

Comment thread neural_network/lstm.py Outdated

return outputs

def backward(self, errors: list, inputs: list) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward

Comment thread neural_network/lstm.py
):
param -= self.lr * grad

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated
# Backward pass and weight updates
self.backward(errors, inputs)

def predict(self, inputs: list) -> str:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function predict

Comment thread neural_network/lstm.py Outdated
output = self.forward(inputs)[-1]
return self.idx_to_char[np.argmax(self.softmax(output))]

def test(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py Outdated
self.char_to_idx = {c: i for i, c in enumerate(self.chars)}
self.idx_to_char = dict(enumerate(self.chars))

self.train_X, self.train_y = self.data[:-1], self.data[1:]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: train_X

Comment thread neural_network/lstm.py
self.initialize_weights()

##### Helper Functions #####
def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_idx[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py Outdated
self.wy = self.init_weights(self.hidden_dim, self.char_size, rng)
self.by = np.zeros((self.char_size, 1))

def init_weights(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
)

##### Activation Functions #####
def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return exp_x / exp_x.sum(axis=0)

##### LSTM Network Methods #####
def reset(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function reset

Comment thread neural_network/lstm.py Outdated
self.input_gates = {}
self.outputs = {}

def forward(self, inputs: list) -> list:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward

Comment thread neural_network/lstm.py Outdated

return outputs

def backward(self, errors: list, inputs: list) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward

Comment thread neural_network/lstm.py
self.wy += d_wy * self.lr
self.by += d_by * self.lr

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated

self.backward(errors, self.concat_inputs)

def test(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py Outdated
self.char_to_idx = {c: i for i, c in enumerate(self.chars)}
self.idx_to_char = dict(enumerate(self.chars))

self.train_X, self.train_y = self.data[:-1], self.data[1:]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: train_X

Comment thread neural_network/lstm.py
self.initialize_weights()

##### Helper Functions #####
def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_idx[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py Outdated
self.wy = self.init_weights(self.hidden_dim, self.char_size)
self.by = np.zeros((self.char_size, 1))

def init_weights(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
)

##### Activation Functions #####
def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return exp_x / exp_x.sum(axis=0)

##### LSTM Network Methods #####
def reset(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function reset

Comment thread neural_network/lstm.py Outdated
self.input_gates = {}
self.outputs = {}

def forward(self, inputs: list) -> list:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward

Comment thread neural_network/lstm.py Outdated

return outputs

def backward(self, errors: list, inputs: list) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward

Comment thread neural_network/lstm.py
self.wy += d_wy * self.lr
self.by += d_by * self.lr

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated

self.backward(errors, self.concat_inputs)

def test(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py

self.initialize_weights()

def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_idx[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py
self.wy: np.ndarray = self.init_weights(self.hidden_dim, self.char_size)
self.by: np.ndarray = np.zeros((self.char_size, 1))

def init_weights(self, input_dim: int, output_dim: int) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
6 / (input_dim + output_dim)
)

def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return x * (1 - x)
return 1 / (1 + np.exp(-x))

def tanh(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function tanh

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
exp_x = np.exp(x - np.max(x))
return exp_x / exp_x.sum(axis=0)

def reset(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function reset

Comment thread neural_network/lstm.py Outdated
self.input_gates = {}
self.outputs = {}

def forward(self, inputs: list[np.ndarray]) -> list[np.ndarray]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward

Comment thread neural_network/lstm.py Outdated

return outputs

def backward(self, errors: list[np.ndarray], inputs: list[np.ndarray]) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward

Comment thread neural_network/lstm.py
self.wy += d_wy * self.lr
self.by += d_by * self.lr

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated

self.backward(errors, inputs)

def test(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py

self.initialize_weights()

def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_idx[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py
self.wy: np.ndarray = self.init_weights(self.hidden_dim, self.char_size)
self.by: np.ndarray = np.zeros((self.char_size, 1))

def init_weights(self, input_dim: int, output_dim: int) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
6 / (input_dim + output_dim)
)

def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return x * (1 - x)
return 1 / (1 + np.exp(-x))

def tanh(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function tanh

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
exp_x = np.exp(x - np.max(x))
return exp_x / exp_x.sum(axis=0)

def reset(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function reset

Comment thread neural_network/lstm.py Outdated
self.input_gates = {}
self.outputs = {}

def forward(self, inputs: list[np.ndarray]) -> list[np.ndarray]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward

Comment thread neural_network/lstm.py Outdated

return outputs

def backward(self, errors: list[np.ndarray], inputs: list[np.ndarray]) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward

Comment thread neural_network/lstm.py
self.wy += d_wy * self.lr
self.by += d_by * self.lr

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated

self.backward(errors, inputs)

def test(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot removed the tests are failing Do not merge until tests pass label Oct 15, 2024
@LEVIII007

Copy link
Copy Markdown
Author

if it gets accepted, please give me hacktober fest accepted tag. Thank you!

@algorithms-keeper algorithms-keeper Bot added the require type hints https://docs.python.org/3/library/typing.html label Oct 15, 2024

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py

self.initialize_weights()

def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_index[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py
)
self.output_layer_bias: np.ndarray = np.zeros((self.vocabulary_size, 1))

def init_weights(self, input_dim: int, output_dim: int) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
6 / (input_dim + output_dim)
)

def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return x * (1 - x)
return 1 / (1 + np.exp(-x))

def tanh(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function tanh

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return 1 - x**2
return np.tanh(x)

def softmax(self, x: np.ndarray) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function softmax

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py
exp_x = np.exp(x - np.max(x))
return exp_x / exp_x.sum(axis=0)

def reset_network_state(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function reset_network_state

Comment thread neural_network/lstm.py
self.output_gate_activations = {}
self.network_outputs = {}

def forward_pass(self, inputs: list[np.ndarray]) -> list[np.ndarray]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward_pass

Comment thread neural_network/lstm.py

return outputs

def backward_pass(self, errors: list[np.ndarray], inputs: list[np.ndarray]) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward_pass

Comment thread neural_network/lstm.py Outdated

return output

def test_lstm_workflow():

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please provide return type hint for the function: test_lstm_workflow. If the function does not return a value, please provide the type hint as: def function() -> None:

@algorithms-keeper algorithms-keeper Bot added the tests are failing Do not merge until tests pass label Oct 15, 2024
@algorithms-keeper algorithms-keeper Bot removed the tests are failing Do not merge until tests pass label Oct 15, 2024

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py

self.initialize_weights()

def one_hot_encode(self, char: str) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function one_hot_encode

Comment thread neural_network/lstm.py
vector[self.char_to_index[char]] = 1
return vector

def initialize_weights(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function initialize_weights

Comment thread neural_network/lstm.py
)
self.output_layer_bias: np.ndarray = np.zeros((self.vocabulary_size, 1))

def init_weights(self, input_dim: int, output_dim: int) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
6 / (input_dim + output_dim)
)

def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function sigmoid

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return x * (1 - x)
return 1 / (1 + np.exp(-x))

def tanh(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function tanh

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py
exp_x = np.exp(x - np.max(x))
return exp_x / exp_x.sum(axis=0)

def reset_network_state(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function reset_network_state

Comment thread neural_network/lstm.py
self.output_gate_activations = {}
self.network_outputs = {}

def forward_pass(self, inputs: list[np.ndarray]) -> list[np.ndarray]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward_pass

Comment thread neural_network/lstm.py

return outputs

def backward_pass(self, errors: list[np.ndarray], inputs: list[np.ndarray]) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward_pass

Comment thread neural_network/lstm.py
self.output_layer_weights += d_output_layer_weights * self.learning_rate
self.output_layer_bias += d_output_layer_bias * self.learning_rate

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated

self.backward_pass(errors, inputs)

def test(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please provide return type hint for the function: test. If the function does not return a value, please provide the type hint as: def function() -> None:

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread neural_network/lstm.py
)
self.output_layer_bias = np.zeros((self.vocabulary_size, 1))

def init_weights(self, input_dim: int, output_dim: int) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function init_weights

Comment thread neural_network/lstm.py Outdated
6 / (input_dim + output_dim)
)

def sigmoid(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return x * (1 - x)
return 1 / (1 + np.exp(-x))

def tanh(self, x: np.ndarray, derivative: bool = False) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py Outdated
return 1 - x**2
return np.tanh(x)

def softmax(self, x: np.ndarray) -> np.ndarray:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please provide descriptive name for the parameter: x

Comment thread neural_network/lstm.py
self.output_gate_activations = {}
self.network_outputs = {}

def forward_pass(self, inputs: list[np.ndarray]) -> list[np.ndarray]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function forward_pass

Comment thread neural_network/lstm.py

return outputs

def backward_pass(self, errors: list[np.ndarray], inputs: list[np.ndarray]) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function backward_pass

Comment thread neural_network/lstm.py
self.output_layer_weights += d_output_layer_weights * self.learning_rate
self.output_layer_bias += d_output_layer_bias * self.learning_rate

def train(self) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function train

Comment thread neural_network/lstm.py Outdated

self.backward_pass(errors, inputs)

def test(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please provide return type hint for the function: test. If the function does not return a value, please provide the type hint as: def function() -> None:

As there is no test file in this pull request nor any test function or class in the file neural_network/lstm.py, please provide doctest for the function test

@algorithms-keeper algorithms-keeper Bot removed require descriptive names This PR needs descriptive function and/or variable names require tests Tests [doctest/unittest/pytest] are required require type hints https://docs.python.org/3/library/typing.html labels Oct 16, 2024
@cclauss

cclauss commented Sep 6, 2026

Copy link
Copy Markdown
Member

@priya-sundaram-dev Your review, please.

@priya-sundaram-dev priya-sundaram-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the ping, @cclauss — happy to review. And nice work @LEVIII007: this is a genuine from-scratch LSTM with a full forward pass and BPTT backward pass, clear docstrings, and doctests throughout — a good fit for neural_network/. I pulled the branch and ran the doctests locally (numpy 2.5.2): all pass, and train()/backward_pass() run cleanly on the sample.

A few things I'd tidy before merge:

Should fix

  1. Remove the commented-out code. There are dead # print(...) lines in __init__ and test(), and the entire demo in if __name__ == "__main__": is commented out — so sample_data is currently unused and the block only runs doctest.testmod(). The repo style is to avoid commented-out code. I'd either wire up a small runnable demo (a short string, a few epochs, print the accuracy) or drop the block entirely.

  2. test() computes accuracy but never uses it — its only consumer is a commented-out print. Either return/report it (e.g. return the accuracy alongside the output, or print it in the demo) or remove the counter so there's no unused-variable smell.

  3. Docstring parameter names don't match the signatures. sigmoid, tanh, and softmax document :param x: but the parameter is input_array. Aligning these keeps the docs accurate (and quiets the doc checks).

Nits

  • self.unique_chars: setset[str] to match the precise annotations you use elsewhere (dict[str, int], etc.).
  • Consider accepting an optional seed and using np.random.default_rng(seed) so demos are reproducible. Not blocking — your doctests already avoid asserting on random draws — but the repo leans deterministic.

None of these touch the algorithm itself, which reads correctly. Once the dead code and the accuracy/docstring items are cleaned up, this looks close to mergeable. Thanks again for contributing it!

@cclauss cclauss added awaiting changes A maintainer has requested changes to this PR and removed awaiting reviews This PR is ready to be reviewed labels Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes A maintainer has requested changes to this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants