-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
500 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** \file BlueNets.h | ||
\author Wojciech Jarosz | ||
*/ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <pcg32.h> | ||
#include <sampler/Sampler.h> | ||
#include <vector> | ||
|
||
/** | ||
Generates optimized (0, m, 2)-nets, as described in the paper: | ||
Ahmed and Wonka: "Optimizing Dyadic Nets" | ||
Based on the `net-optimize-pointers.cpp` code by Ahmed, which contains no license. | ||
*/ | ||
class BlueNets : public TSamplerDim<2> | ||
{ | ||
public: | ||
BlueNets(unsigned n = 2); | ||
|
||
void sample(float[], unsigned i) override; | ||
|
||
std::string name() const override | ||
{ | ||
return "Blue nets"; | ||
} | ||
|
||
int numSamples() const override | ||
{ | ||
return pointCount; | ||
} | ||
int setNumSamples(unsigned num) override; | ||
|
||
bool randomized() const override | ||
{ | ||
return m_randomize; | ||
} | ||
void setRandomized(bool r = true) override; | ||
|
||
private: | ||
void regenerate(); | ||
|
||
std::vector<float> xs, ys; | ||
|
||
bool m_randomize = true; | ||
int iterations = 1; | ||
double sigma = 0.5; | ||
std::string optimizationSequence = "v"; | ||
double rf = 0.75; | ||
int range = 0; | ||
uint32_t pointCount = 1; | ||
|
||
pcg32 m_rand; | ||
}; |
Oops, something went wrong.