- Timestamp:
- Jan 29, 2019, 2:55:31 AM (6 years ago)
- Branches:
- feature/crepe_org
- Children:
- 382375d
- Parents:
- e2010b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ai/dense.h
re2010b3 r30cb440e 24 24 /** \file 25 25 26 Fully connected dense layer.26 Fully connected layer 27 27 28 28 */ … … 32 32 #endif 33 33 34 /** dense layer */ 34 35 typedef struct _aubio_dense_t aubio_dense_t; 35 36 37 /** create a new dense layer 38 39 \param n_units number of units 40 41 \return new dense layer 42 43 */ 36 44 aubio_dense_t *new_aubio_dense(uint_t n_units); 37 45 38 void del_aubio_dense(aubio_dense_t *c); 46 /** get output shape 39 47 48 \param c ::aubio_dense_t layer 49 \param input input tensor 50 \param shape output shape 51 52 \return 0 on success, non-zero otherwise 53 54 */ 40 55 uint_t aubio_dense_get_output_shape(aubio_dense_t *c, 41 56 aubio_tensor_t *input, uint_t *shape); 42 57 58 /** get internal weights 59 60 \param c dense layer 61 62 \return matrix of weights 63 64 This function should be called after ::aubio_dense_get_output_shape 65 to get a pointer to the internal weight matrix. 66 67 */ 43 68 fmat_t *aubio_dense_get_weights(aubio_dense_t *c); 44 69 70 /** get internal biases 71 72 \param c dense layer 73 74 \return vector of biases 75 76 This function should be called after ::aubio_dense_get_output_shape 77 to get a pointer to the internal biases. 78 79 */ 45 80 fvec_t *aubio_dense_get_bias(aubio_dense_t *c); 46 81 82 /** compute forward pass 83 84 \param c ::aubio_dense_t layer 85 \param input input tensor 86 \param output output tensor 87 88 This function computes the output of the dense layer given an input tensor. 89 90 */ 47 91 void aubio_dense_do(aubio_dense_t *c, aubio_tensor_t *input, 48 92 aubio_tensor_t *output); 93 94 /** destroy layer 95 96 \param c layer to destroy 97 98 */ 99 void del_aubio_dense(aubio_dense_t *c); 49 100 50 101 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.