1#ifndef _BBM_COSINEWEIGHTEDL2_H_
2#define _BBM_COSINEWEIGHTEDL2_H_
24 template<
typename CONF>
requires concepts::config<CONF>
52 template<
typename BSDF,
typename REFERENCE, bsdf_flag COMPONENT=bsdf_flag::All, unit_t UNIT=unit_t::Radiance>
56 struct nganL2 :
public sampledlossfunction<BSDF, REFERENCE, nganL2_error<get_config<BSDF>>, spherical_linearizer<get_config<BSDF>>, COMPONENT, UNIT>
73 const vec2d<Size_t>& samplesIn,
74 const vec2d<Size_t>& samplesOut,
75 const Vec2d& startIn=0,
const Vec2d& endIn=Constants::Hemisphere(),
76 const Vec2d& startOut=0,
const Vec2d& endOut=Constants::Hemisphere())
77 :
sampledlossfunction<BSDF, REFERENCE,
nganL2_error<Config>,
spherical_linearizer<Config>, COMPONENT, UNIT>(
bsdf,
reference,
nganL2_error<Config>(),
spherical_linearizer<Config>(samplesIn, samplesOut, startIn, endIn, startOut, endOut)) {}
95 template<
typename CONF>
requires concepts::config<CONF>
123 template<
typename BSDF,
typename REFERENCE, bsdf_flag COMPONENT=bsdf_flag::All, unit_t UNIT=unit_t::Radiance>
127 struct lowL2 :
public sampledlossfunction<BSDF, REFERENCE, lowL2_error<get_config<BSDF>>, spherical_linearizer<get_config<BSDF>>, COMPONENT, UNIT>
144 const vec2d<Size_t>& samplesIn,
145 const Size_t& samplesOut,
146 const Vec2d& startIn=0,
const Vec2d& endIn=Constants::Hemisphere(),
147 const Scalar& startOut=0,
const Scalar& endOut=Constants::Pi(0.5))
148 :
sampledlossfunction<BSDF, REFERENCE,
lowL2_error<Config>,
spherical_linearizer<Config>, COMPONENT, UNIT>(
bsdf,
reference,
lowL2_error<Config>(),
spherical_linearizer<Config>(samplesIn, vec2d<Size_t>(1, samplesOut), startIn, endIn, startOut, Vec2d(Constants::Pi(2.0), endOut))) {}
165 template<
typename CONF>
requires concepts::config<CONF>
194 template<
typename BSDF,
typename REFERENCE, bsdf_flag COMPONENT=bsdf_flag::All, unit_t UNIT=unit_t::Radiance>
198 struct bieronL2 :
public sampledlossfunction<BSDF, REFERENCE, bieronL2_error<get_config<BSDF>>, spherical_linearizer<get_config<BSDF>>, COMPONENT, UNIT>
215 const vec2d<Size_t>& samplesIn,
216 const vec2d<Size_t>& samplesOut,
217 const Vec2d& startIn=0,
const Vec2d& endIn=Constants::Hemisphere(),
218 const Vec2d& startOut=0,
const Vec2d& endOut=Constants::Hemisphere())
219 :
sampledlossfunction<BSDF, REFERENCE,
bieronL2_error<Config>,
spherical_linearizer<Config>, COMPONENT, UNIT>(
bsdf,
reference,
bieronL2_error<Config>(),
spherical_linearizer<Config>(samplesIn, samplesOut, startIn, endIn, startOut, endOut)) {}
Definition of a loss function that is the sum of losses on samples.
BSDF implementation of a BSDF model.
Definition: bsdf.h:30
bsdfmodel concept
Definition: bsdfmodel.h:33
matching_config concept
Definition: config.h:63
Definition: samplelossfunction.h:28
#define BBM_CHECK_CONCEPT(CONCEPTNAME, CLASSNAME,...)
Check a class for a concept with bbm::concepts::archetypes in the namespace.
Definition: macro.h:35
T sinTheta(const vec2d< T > &v)
Definition: spherical.h:75
T cosTheta(const vec2d< T > &v)
Definition: spherical.h:109
Definition: aggregatebsdf.h:29
decltype(auto) value(T &&t)
return the value of an attribute, or if not an attribute the object
Definition: attribute_value.h:20
Methods for handling spherical coordinates.
Bieron and Peers cosine weighted l2 error.
Definition: cosine_weighted_l2.h:167
Value operator()(const Vec3d &in, const Vec3d &out, const Spectrum &value, const Spectrum &reference) const
Definition: cosine_weighted_l2.h:170
bieronL2 loss function
Definition: cosine_weighted_l2.h:199
bieronL2(const BSDF &bsdf, const REFERENCE &reference, const vec2d< Size_t > &samplesIn, const vec2d< Size_t > &samplesOut, const Vec2d &startIn=0, const Vec2d &endIn=Constants::Hemisphere(), const Vec2d &startOut=0, const Vec2d &endOut=Constants::Hemisphere())
Constructor.
Definition: cosine_weighted_l2.h:214
Low et al. cosine weighted l2 error.
Definition: cosine_weighted_l2.h:97
Value operator()(const Vec3d &in, const Vec3d &, const Spectrum &value, const Spectrum &reference) const
Definition: cosine_weighted_l2.h:100
lowL2 loss function
Definition: cosine_weighted_l2.h:128
lowL2(const BSDF &bsdf, const REFERENCE &reference, const vec2d< Size_t > &samplesIn, const Size_t &samplesOut, const Vec2d &startIn=0, const Vec2d &endIn=Constants::Hemisphere(), const Scalar &startOut=0, const Scalar &endOut=Constants::Pi(0.5))
Constructor.
Definition: cosine_weighted_l2.h:143
Standard cosine weighted l2 error.
Definition: cosine_weighted_l2.h:26
Value operator()(const Vec3d &in, const Vec3d &out, const Spectrum &value, const Spectrum &reference) const
Definition: cosine_weighted_l2.h:29
nganL2 loss function
Definition: cosine_weighted_l2.h:57
nganL2(const BSDF &bsdf, const REFERENCE &reference, const vec2d< Size_t > &samplesIn, const vec2d< Size_t > &samplesOut, const Vec2d &startIn=0, const Vec2d &endIn=Constants::Hemisphere(), const Vec2d &startOut=0, const Vec2d &endOut=Constants::Hemisphere())
Constructor.
Definition: cosine_weighted_l2.h:72
Non-persistent reference (i.e., cannot take rvalues)
Definition: reference.h:86
sampledlossfunction
Definition: sampledlossfunction.h:35
Definition: spherical_linearizer.h:26