0 | {--
 1 | Copyright (C) 2021  Joel Berkeley
 2 |
 3 | This program is free software: you can redistribute it and/or modify
 4 | it under the terms of the GNU Affero General Public License as published
 5 | by the Free Software Foundation, either version 3 of the License, or
 6 | (at your option) any later version.
 7 |
 8 | This program is distributed in the hope that it will be useful,
 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 | GNU Affero General Public License for more details.
12 |
13 | You should have received a copy of the GNU Affero General Public License
14 | along with this program.  If not, see <https://www.gnu.org/licenses/>.
15 | --}
16 | ||| Mean functions, particularly for use in Gaussian processes.
17 | module Model.MeanFunction
18 |
19 | import Tensor
20 |
21 | ||| A `MeanFunction` maps a point in feature space to the mean value of a corresponding
22 | ||| distribution in target space.
23 | |||
24 | ||| @features The shape of the feature domain.
25 | public export 0
26 | MeanFunction : (0 features : Shape) -> Type
27 | MeanFunction features = {sm : _} -> Tensor (sm :: features) F64 -> Tag $ Tensor [sm] F64
28 |
29 | ||| A mean function where the mean is zero in all target dimensions.
30 | export
31 | zero : MeanFunction features
32 | zero _ = pure $ fill 0
33 |