feat: support Brownian tree noise in all noise injection samplers (#1899)

This commit is contained in:
Wagner Bruna authored and GitHub committed 2026-09-15 02:37:31 +08:00
1 parent f9ddc0f388
commit 07a85c74cb
5 files changed
+233 -191

No files matched your search

+7
View File
@@ -1,6 +1,8 @@
#ifndef __SD_CORE_RNG_HPP__
#define __SD_CORE_RNG_HPP__
#include <cstdint>
#include <memory>
#include <random>
#include <vector>
@@ -8,6 +10,7 @@ class RNG {
public:
virtual void manual_seed(uint64_t seed) = 0;
virtual std::vector<float> randn(uint32_t n) = 0;
virtual std::shared_ptr<RNG> clone() const = 0;
};
class STDDefaultRNG : public RNG {
@@ -15,6 +18,10 @@ private:
std::default_random_engine generator;
public:
std::shared_ptr<RNG> clone() const override {
return std::make_shared<STDDefaultRNG>(*this);
}
void manual_seed(uint64_t seed) override {
generator.seed((unsigned int)seed);
}