shark::Wave Class Reference

Noisy sinc function: y = sin(x) / x + noise. More...

#include <shark/Data/DataDistribution.h>

+ Inheritance diagram for shark::Wave:

Public Member Functions

 Wave (double stddev=0.1, double range=5.0)
 
void draw (RealVector &input, RealVector &label) const
 Generates a single pair of input and label. More...
 
- Public Member Functions inherited from shark::LabeledDataDistribution< RealVector, RealVector >
virtual ~LabeledDataDistribution ()
 Virtual destructor. More...
 
std::pair< RealVector, RealVector > operator() ()
 
LabeledData< RealVector, RealVector > generateDataset (std::size_t size, std::size_t maximumBatchSize) const
 Generates a dataset with samples from from the distribution. More...
 
LabeledData< RealVector, RealVector > generateDataset (std::size_t size) const
 Generates a data set with samples from from the distribution. More...
 

Protected Attributes

double m_stddev
 
double m_range
 

Detailed Description

Noisy sinc function: y = sin(x) / x + noise.

Definition at line 186 of file DataDistribution.h.

Constructor & Destructor Documentation

◆ Wave()

shark::Wave::Wave ( double  stddev = 0.1,
double  range = 5.0 
)
inline

Definition at line 189 of file DataDistribution.h.

Member Function Documentation

◆ draw()

void shark::Wave::draw ( RealVector &  input,
RealVector &  label 
) const
inlinevirtual

Generates a single pair of input and label.

Parameters
inputthe generated input
labelthe generated label

Implements shark::LabeledDataDistribution< RealVector, RealVector >.

Definition at line 195 of file DataDistribution.h.

References shark::random::gauss(), shark::random::globalRng, and shark::random::uni().

Member Data Documentation

◆ m_range

double shark::Wave::m_range
protected

Definition at line 207 of file DataDistribution.h.

◆ m_stddev

double shark::Wave::m_stddev
protected

Definition at line 206 of file DataDistribution.h.


The documentation for this class was generated from the following file: