teeny_core/nn/activation/
sigmoid.rs1use core::marker::PhantomData;
18
19use crate::{
20 dtype::{EagerTensor, Float, Tensor},
21 nn::Layer,
22};
23
24pub struct Sigmoid<D: Float, T, const RANK: usize> {
26 _pd: PhantomData<(D, T)>,
27}
28
29impl<D: Float, T, const RANK: usize> Sigmoid<D, T, RANK> {
30 pub fn new() -> Self {
32 Self { _pd: PhantomData }
33 }
34}
35
36impl<D: Float, T, const RANK: usize> Default for Sigmoid<D, T, RANK> {
37 fn default() -> Self {
38 Self::new()
39 }
40}
41
42impl<D: Float, T: Tensor<D, RANK> + EagerTensor, const RANK: usize> Layer<T>
43 for Sigmoid<D, T, RANK>
44{
45 type Output = T;
46 fn call(&self, _input: T) -> Self::Output {
47 todo!()
48 }
49}
50
51pub struct Silu<D: Float, T, const RANK: usize> {
53 _pd: PhantomData<(D, T)>,
54}
55
56impl<D: Float, T, const RANK: usize> Silu<D, T, RANK> {
57 pub fn new() -> Self {
59 Self { _pd: PhantomData }
60 }
61}
62
63impl<D: Float, T, const RANK: usize> Default for Silu<D, T, RANK> {
64 fn default() -> Self {
65 Self::new()
66 }
67}
68
69impl<D: Float, T: Tensor<D, RANK> + EagerTensor, const RANK: usize> Layer<T> for Silu<D, T, RANK> {
70 type Output = T;
71 fn call(&self, _input: T) -> Self::Output {
72 todo!()
73 }
74}
75
76pub struct Logsigmoid<D: Float, T, const RANK: usize> {
78 _pd: PhantomData<(D, T)>,
79}
80
81impl<D: Float, T, const RANK: usize> Logsigmoid<D, T, RANK> {
82 pub fn new() -> Self {
84 Self { _pd: PhantomData }
85 }
86}
87
88impl<D: Float, T, const RANK: usize> Default for Logsigmoid<D, T, RANK> {
89 fn default() -> Self {
90 Self::new()
91 }
92}
93
94impl<D: Float, T: Tensor<D, RANK> + EagerTensor, const RANK: usize> Layer<T>
95 for Logsigmoid<D, T, RANK>
96{
97 type Output = T;
98 fn call(&self, _input: T) -> Self::Output {
99 todo!()
100 }
101}