Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
simd_generalized_loss.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
11#include <momentum/simd/simd.h>
12
13namespace momentum {
14
32template <typename T>
34 public:
36
42 explicit SimdGeneralizedLossT(const T& a = Base::kL2, const T& c = T(1));
43
47 [[nodiscard]] Packet<T> value(const Packet<T>& sqrError) const;
48
53 [[nodiscard]] Packet<T> deriv(const Packet<T>& sqrError) const;
54};
55
56} // namespace momentum
GeneralizedLossT(const T &a=kL2, const T &c=T(1))
Constructs a generalized loss with shape a and scale c.
Packet< T > value(const Packet< T > &sqrError) const
Returns the loss value for each lane of sqrError.
SimdGeneralizedLossT(const T &a=Base::kL2, const T &c=T(1))
Constructs a SIMD generalized loss with shape a and scale c.
Packet< T > deriv(const Packet< T > &sqrError) const
Returns d(loss)/d(sqrError) for each lane of sqrError.
drjit::Packet< T, kSimdPacketSize > Packet
A fixed-size SIMD packet of kSimdPacketSize elements of type T.
Definition simd.h:71
Cross-platform SIMD foundation built on the DrJit library.