arm_svm_sigmoid_init_f32.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* ----------------------------------------------------------------------
  2. * Project: CMSIS DSP Library
  3. * Title: arm_svm_sigmoid_predict_f32.c
  4. * Description: SVM Sigmoid Instance Initialization
  5. *
  6. *
  7. * Target Processor: Cortex-M and Cortex-A cores
  8. * -------------------------------------------------------------------- */
  9. /*
  10. * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the License); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at
  17. *
  18. * www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. */
  26. #include "arm_math.h"
  27. #include <limits.h>
  28. #include <math.h>
  29. /**
  30. * @addtogroup groupSVM
  31. * @{
  32. */
  33. /**
  34. * @brief SVM sigmoid instance init function
  35. *
  36. * Classes are integer used as output of the function (instead of having -1,1
  37. * as class values).
  38. *
  39. * @param[in] S points to an instance of the rbf SVM structure.
  40. * @param[in] nbOfSupportVectors Number of support vectors
  41. * @param[in] vectorDimension Dimension of vector space
  42. * @param[in] intercept Intercept
  43. * @param[in] dualCoefficients Array of dual coefficients
  44. * @param[in] supportVectors Array of support vectors
  45. * @param[in] classes Array of 2 classes ID
  46. * @param[in] coef0 coeff0 (scikit-learn terminology)
  47. * @param[in] gamma gamma (scikit-learn terminology)
  48. * @return none.
  49. *
  50. */
  51. void arm_svm_sigmoid_init_f32(arm_svm_sigmoid_instance_f32 *S,
  52. uint32_t nbOfSupportVectors,
  53. uint32_t vectorDimension,
  54. float32_t intercept,
  55. const float32_t *dualCoefficients,
  56. const float32_t *supportVectors,
  57. const int32_t *classes,
  58. float32_t coef0,
  59. float32_t gamma
  60. )
  61. {
  62. S->nbOfSupportVectors = nbOfSupportVectors;
  63. S->vectorDimension = vectorDimension;
  64. S->intercept = intercept;
  65. S->dualCoefficients = dualCoefficients;
  66. S->supportVectors = supportVectors;
  67. S->classes = classes;
  68. S->coef0 = coef0;
  69. S->gamma = gamma;
  70. }
  71. /**
  72. * @} end of groupSVM group
  73. */