fvec_t *moving_variance;
};
+#if defined(DEBUG)
static void aubio_batchnorm_debug(aubio_batchnorm_t *c,
aubio_tensor_t *input_tensor);
+#endif
aubio_batchnorm_t *new_aubio_batchnorm(void)
{
AUBIO_FREE(c);
}
+#if defined(DEBUG)
void aubio_batchnorm_debug(aubio_batchnorm_t *c, aubio_tensor_t *input_tensor)
{
AUBIO_DBG("batchnorm: %15s -> %s (%d params) (4 * (%d,))\n",
aubio_tensor_get_shape_string(input_tensor), // same output shape
c->n_outputs, 4 * c->n_outputs);
}
+#endif
uint_t aubio_batchnorm_get_output_shape(aubio_batchnorm_t *c,
aubio_tensor_t *input, uint_t *shape)
return AUBIO_FAIL;
}
+#if defined(DEBUG)
aubio_batchnorm_debug(c, input);
+#endif
return AUBIO_OK;
}
#endif
};
+#if defined(DEBUG)
static
void aubio_conv1d_debug(aubio_conv1d_t *c, aubio_tensor_t *input_tensor);
+#endif
aubio_conv1d_t *new_aubio_conv1d(uint_t n_filters, uint_t kernel_shape[1])
{
shape[0] = output_shape[0];
shape[1] = output_shape[1];
+#if defined(DEBUG)
aubio_conv1d_debug(c, input_tensor);
+#endif
return AUBIO_OK;
}
+#if defined(DEBUG)
void aubio_conv1d_debug(aubio_conv1d_t *c, aubio_tensor_t *input_tensor)
{
// print some info
c->stride_shape[0],
-c->padding_start);
}
+#endif
uint_t aubio_conv1d_check_output_shape(aubio_conv1d_t *c,
aubio_tensor_t *input_tensor,
#endif
};
+#if defined(DEBUG)
static void aubio_conv2d_debug(aubio_conv2d_t *c, aubio_tensor_t *input_tensor);
+#endif
aubio_conv2d_t *new_aubio_conv2d(uint_t n_filters, uint_t kernel_shape[2])
{
}
#endif
+#if defined(DEBUG)
aubio_conv2d_debug(c, input_tensor);
+#endif
return AUBIO_OK;
}
+#if defined(DEBUG)
void aubio_conv2d_debug(aubio_conv2d_t *c, aubio_tensor_t *input_tensor)
{
// print some info
c->stride_shape[0], c->stride_shape[1],
-c->padding_start[0], -c->padding_start[1]);
}
+#endif
uint_t aubio_conv2d_check_output_shape(aubio_conv2d_t *c,
aubio_tensor_t *input_tensor,
AUBIO_FREE(c);
}
+#if defined(DEBUG)
void aubio_dense_debug(aubio_dense_t *c, aubio_tensor_t *input_tensor)
{
uint_t n_params = input_tensor->shape[0] * c->n_units + c->n_units;
aubio_tensor_get_shape_string(input_tensor), c->n_units, n_params,
c->n_units, c->weights->height, c->weights->length, c->bias->length);
}
+#endif
uint_t aubio_dense_get_output_shape(aubio_dense_t *c,
aubio_tensor_t *input, uint_t *shape)
c->bias = new_fvec(c->n_units);
if (!c->bias) return AUBIO_FAIL;
+#if defined(DEBUG)
aubio_dense_debug(c, input);
+#endif
return AUBIO_OK;
}
uint_t stride;
};
+#if defined(DEBUG)
static void aubio_maxpool1d_debug(aubio_maxpool1d_t *c,
aubio_tensor_t *input_tensor);
+#endif
aubio_maxpool1d_t *new_aubio_maxpool1d(uint_t pool_size[1])
{
AUBIO_FREE(c);
}
+#if defined(DEBUG)
void aubio_maxpool1d_debug(aubio_maxpool1d_t *c, aubio_tensor_t *input_tensor)
{
AUBIO_DBG("maxpool1d: %15s -> (%d, %d) (no params)"
input_tensor->shape[0] / c->pool_size,
input_tensor->shape[1], c->pool_size);
}
+#endif
uint_t aubio_maxpool1d_get_output_shape(aubio_maxpool1d_t *c,
aubio_tensor_t *input, uint_t *shape)
shape[0] = input->shape[0] / c->pool_size;
shape[1] = input->shape[1];
+#if defined(DEBUG)
aubio_maxpool1d_debug(c, input);
+#endif
return AUBIO_OK;
}
uint_t stride[2];
};
+#if defined(DEBUG)
static void aubio_maxpool2d_debug(aubio_maxpool2d_t *c,
aubio_tensor_t *input_tensor);
+#endif
aubio_maxpool2d_t *new_aubio_maxpool2d(uint_t pool_size[2])
{
AUBIO_FREE(c);
}
+#if defined(DEBUG)
void aubio_maxpool2d_debug(aubio_maxpool2d_t *c, aubio_tensor_t *input_tensor)
{
AUBIO_DBG("maxpool2d: %15s -> (%d, %d, %d)"
c->pool_size[0],
c->pool_size[1]);
}
+#endif
uint_t aubio_maxpool2d_get_output_shape(aubio_maxpool2d_t *c,
aubio_tensor_t *input, uint_t *shape)
shape[1] = input->shape[1] / c->pool_size[1];
shape[2] = input->shape[2];
+#if defined(DEBUG)
aubio_maxpool2d_debug(c, input);
+#endif
return AUBIO_OK;
}