Changeset 567727d


Ignore:
Timestamp:
Dec 29, 2021, 5:51:47 PM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe
Children:
bacf0c6
Parents:
83ef8f0
git-author:
Paul Brossier <piem@piem.org> (01/07/19 22:19:48)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:51:47)
Message:

[fvec] add fvec_vecadd

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/fvec.c

    r83ef8f0 r567727d  
    9999}
    100100
     101void fvec_vecadd(fvec_t *s, const fvec_t *bias) {
     102  uint_t j;
     103  uint_t length = MIN(s->length, bias->length);
     104  for (j = 0; j < length; j++) {
     105    s->data[j] += bias->data[j];
     106  }
     107}
     108
    101109void fvec_weight(fvec_t *s, const fvec_t *weight) {
    102110  uint_t length = MIN(s->length, weight->length);
  • src/fvec.h

    r83ef8f0 r567727d  
    144144void fvec_rev(fvec_t *s);
    145145
     146/** add a vector b to vector a, modifying a
     147
     148  \param a  input vector to add b to
     149  \param b  input vector of the values to be added to a
     150
     151  Upon return, he content of a[i] will be set to a[i] + b[i].
     152
     153*/
     154void fvec_vecadd(fvec_t *a, const fvec_t *b);
     155
    146156/** apply weight to vector
    147157
Note: See TracChangeset for help on using the changeset viewer.