bayes_functions_f16.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /******************************************************************************
  2. * @file bayes_functions_f16.h
  3. * @brief Public header file for CMSIS DSP Library
  4. * @version V1.10.0
  5. * @date 08 July 2021
  6. * Target Processor: Cortex-M and Cortex-A cores
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved.
  10. *
  11. * SPDX-License-Identifier: Apache-2.0
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the License); you may
  14. * not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  21. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. */
  25. #ifndef _BAYES_FUNCTIONS_F16_H_
  26. #define _BAYES_FUNCTIONS_F16_H_
  27. #include "arm_math_types_f16.h"
  28. #include "arm_math_memory.h"
  29. #include "dsp/none.h"
  30. #include "dsp/utils.h"
  31. #include "dsp/statistics_functions_f16.h"
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. #if defined(ARM_FLOAT16_SUPPORTED)
  37. /**
  38. * @brief Instance structure for Naive Gaussian Bayesian estimator.
  39. */
  40. typedef struct
  41. {
  42. uint32_t vectorDimension; /**< Dimension of vector space */
  43. uint32_t numberOfClasses; /**< Number of different classes */
  44. const float16_t *theta; /**< Mean values for the Gaussians */
  45. const float16_t *sigma; /**< Variances for the Gaussians */
  46. const float16_t *classPriors; /**< Class prior probabilities */
  47. float16_t epsilon; /**< Additive value to variances */
  48. } arm_gaussian_naive_bayes_instance_f16;
  49. /**
  50. * @brief Naive Gaussian Bayesian Estimator
  51. *
  52. * @param[in] S points to a naive bayes instance structure
  53. * @param[in] in points to the elements of the input vector.
  54. * @param[out] *pOutputProbabilities points to a buffer of length numberOfClasses containing estimated probabilities
  55. * @param[out] *pBufferB points to a temporary buffer of length numberOfClasses
  56. * @return The predicted class
  57. *
  58. */
  59. uint32_t arm_gaussian_naive_bayes_predict_f16(const arm_gaussian_naive_bayes_instance_f16 *S,
  60. const float16_t * in,
  61. float16_t *pOutputProbabilities,
  62. float16_t *pBufferB);
  63. #endif /*defined(ARM_FLOAT16_SUPPORTED)*/
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* ifndef _BAYES_FUNCTIONS_F16_H_ */