- Timestamp:
- Dec 29, 2021, 5:51:59 PM (3 years ago)
- Branches:
- feature/crepe
- Children:
- 72f450a
- Parents:
- 05808d5
- git-author:
- Paul Brossier <piem@piem.org> (01/18/19 00:28:29)
- git-committer:
- Paul Brossier <piem@piem.org> (12/29/21 17:51:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ai/batchnorm.c
r05808d5 r9b05ea9 131 131 uint_t aubio_batchnorm_set_beta(aubio_batchnorm_t *t, fvec_t *beta) 132 132 { 133 AUBIO_ASSERT(t && t->beta );134 AUBIO_ASSERT(beta);135 if (t->beta->length != beta->length)return AUBIO_FAIL;133 AUBIO_ASSERT(t && t->beta && beta); 134 if (t->beta->length != beta->length) 135 return AUBIO_FAIL; 136 136 fvec_copy(beta, t->beta); 137 137 return AUBIO_OK; 138 138 } 139 139 140 uint_t aubio_batchnorm_set_moving_mean(aubio_batchnorm_t *t, fvec_t *moving_mean) 140 uint_t aubio_batchnorm_set_moving_mean(aubio_batchnorm_t *t, 141 fvec_t *moving_mean) 141 142 { 142 143 AUBIO_ASSERT(t && t->moving_mean); 143 144 AUBIO_ASSERT(moving_mean); 144 if (t->moving_mean->length != moving_mean->length) return AUBIO_FAIL; 145 if (t->moving_mean->length != moving_mean->length) 146 return AUBIO_FAIL; 145 147 fvec_copy(moving_mean, t->moving_mean); 146 148 return AUBIO_OK; 147 149 } 148 150 149 uint_t aubio_batchnorm_set_moving_variance(aubio_batchnorm_t *t, fvec_t *moving_variance) 151 uint_t aubio_batchnorm_set_moving_variance(aubio_batchnorm_t *t, 152 fvec_t *moving_variance) 150 153 { 151 154 AUBIO_ASSERT(t && t->moving_variance); 152 155 AUBIO_ASSERT(moving_variance); 153 if (t->moving_variance->length != moving_variance->length) return AUBIO_FAIL; 156 if (t->moving_variance->length != moving_variance->length) 157 return AUBIO_FAIL; 154 158 fvec_copy(moving_variance, t->moving_variance); 155 159 return AUBIO_OK;
Note: See TracChangeset
for help on using the changeset viewer.