Skip to content

create sinusoidal.py - #15563

Open
bertholeo wants to merge 2 commits into
TheAlgorithms:masterfrom
bertholeo:master
Open

bertholeo wants to merge 2 commits into
TheAlgorithms:masterfrom
bertholeo:master

Conversation

@bertholeo

Copy link
Copy Markdown

Description

This pull request adds the sinusoidal activation function to the neural network activation functions module.

The implementation:

  • Computes sin(omega * x) using NumPy.
  • Supports an optional frequency parameter (omega).
  • Works with multidimensional NumPy arrays.
  • Includes doctests for different inputs.

Sinusoidal activation functions are particularly useful in neural networks such as SIREN, which are designed to represent continuous signals.

Reference: https://arxiv.org/abs/2006.09661

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

Sinusoidal activation function.

Reference:
https://arxiv.org/abs/2006.09661
Adds a sinusoidal activation function to the neural network activation functions directory.

The implementation:

Computes sin(omega * x) using NumPy.

Supports an optional frequency parameter (omega).

Works with multidimensional NumPy arrays.

Includes doctests for different inputs.

Sinusoidal activation functions are used in neural networks such as SIREN for representing continuous signals.

Reference: https://arxiv.org/abs/2006.09661
@algorithms-keeper algorithms-keeper Bot added the awaiting reviews This PR is ready to be reviewed label Oct 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant