Skip to content

Synthesizer class#103

Open
osn07 wants to merge 4 commits intotoolsforexperiments:mainfrom
osn07:synthesizer-class
Open

Synthesizer class#103
osn07 wants to merge 4 commits intotoolsforexperiments:mainfrom
osn07:synthesizer-class

Conversation

@osn07
Copy link

@osn07 osn07 commented Feb 25, 2026

Basic frame for data synthesizer.

…ract model()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Contributor

@marcosfrenkel marcosfrenkel left a comment

Choose a reason for hiding this comment

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

Could you add some implemented examples of how this would look like? You can have some generic functions (Gaussian, exponential, sine, etc.) and in the comments write how an example would look like.

How are the parameters handled? What should I do if I want to generate 2 different sets of data with different parameters?

pass

def generate(self, coordinates):
return self.model(coordinates) + self.noise()
Copy link
Contributor

Choose a reason for hiding this comment

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

You are calling the self.noise() function here, but there is no way to pass a different std value when generating the data.

…ial, sine, and gaussian class implementations
… are now static methods. Parameters can be set at instantiation or overridden in generate().

import numpy as np

import dataclasses
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import dataclasses
from dataclasses import dataclass

"""

@dataclasses.dataclass
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@dataclasses.dataclass
dataclass

return np.random.normal(scale = std, size = len(coordinates))


@dataclasses.dataclass
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@dataclasses.dataclass
dataclass




@dataclasses.dataclass
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@dataclasses.dataclass
dataclass

return A * np.sin(2 * np.pi * coordinates * f + phi) + of


@dataclasses.dataclass
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@dataclasses.dataclass
dataclass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants