|
nnlib
GPU-accelerated, C/C++ neural network library.
|
Source file defining methods of the Layer class. More...
#include "../../include/layer.h"#include "../gpu/allocation_gpu.cuh"#include "runtime.h"#include "verify.cuh"#include <utility>Functions | |
| float | getRandom () |
| Generate a random float value. More... | |
| sTensor | initializeBiases (size_t outSize) |
| Initialize the biases of the layer. More... | |
| sTensor | initializeWeights (size_t inSize, size_t outSize) |
| Initialize the weights of the layer. More... | |
Source file defining methods of the Layer class.
| float getRandom | ( | ) |
Generate a random float value.
Currently the method only returns uniformly distributed numbers in the range (-0.2, 0.2).
| sTensor initializeBiases | ( | size_t | outSize | ) |
Initialize the biases of the layer.
This creates a vector of random numbers using the getRandomValue() method.
| outSize | The size of the vector to generate. It is also the output size of the layer. |
| sTensor initializeWeights | ( | size_t | inSize, |
| size_t | outSize | ||
| ) |
Initialize the weights of the layer.
This creates a matrix of random numbers using the getRandomValue() method.
| inSize | The number of rows of the matrix. It is also the input size to the layer. |
| outSize | The number of columns of the matrix. It is also the output size of the layer. |