[dense] improve documentation
authorPaul Brossier <piem@piem.org>
Tue, 29 Jan 2019 01:55:31 +0000 (02:55 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 29 Dec 2021 16:52:01 +0000 (11:52 -0500)
src/ai/dense.h

index 687f065..159db49 100644 (file)
@@ -23,7 +23,7 @@
 
 /** \file
 
- Fully connected dense layer.
+ Fully connected layer
 
 */
 
 extern "C" {
 #endif
 
+/** dense layer */
 typedef struct _aubio_dense_t aubio_dense_t;
 
+/** create a new dense layer
+
+  \param n_units    number of units
+
+  \return new dense layer
+
+*/
 aubio_dense_t *new_aubio_dense(uint_t n_units);
 
-void del_aubio_dense(aubio_dense_t *c);
+/** get output shape
+
+  \param c      ::aubio_dense_t layer
+  \param input  input tensor
+  \param shape  output shape
+
+  \return 0 on success, non-zero otherwise
 
+*/
 uint_t aubio_dense_get_output_shape(aubio_dense_t *c,
     aubio_tensor_t *input, uint_t *shape);
 
+/** get internal weights
+
+   \param c     dense layer
+
+   \return matrix of weights
+
+   This function should be called after ::aubio_dense_get_output_shape
+   to get a pointer to the internal weight matrix.
+
+*/
 fmat_t *aubio_dense_get_weights(aubio_dense_t *c);
 
+/** get internal biases
+
+   \param c     dense layer
+
+   \return vector of biases
+
+   This function should be called after ::aubio_dense_get_output_shape
+   to get a pointer to the internal biases.
+
+*/
 fvec_t *aubio_dense_get_bias(aubio_dense_t *c);
 
+/** compute forward pass
+
+  \param c          ::aubio_dense_t layer
+  \param input      input tensor
+  \param output     output tensor
+
+  This function computes the output of the dense layer given an input tensor.
+
+*/
 void aubio_dense_do(aubio_dense_t *c, aubio_tensor_t *input,
     aubio_tensor_t *output);
 
+/** destroy layer
+
+  \param c  layer to destroy
+
+*/
+void del_aubio_dense(aubio_dense_t *c);
+
 #ifdef __cplusplus
 }
 #endif