|
My Project
|
Feed-forward dense network with GPU-backed parameters and gradients. More...
Public Member Functions | |
| CudaNetwork (CublasHandle &handle) | |
| Construct a network tied to a cuBLAS handle. More... | |
| void | addLayer (int in, int out, ActivationType act) |
| Append a layer definition. More... | |
| void | bindParams (unsigned int seed=kDefaultSeed) |
| Allocate parameter/gradient buffers and initialize weights. More... | |
| size_t | params_size () const |
| Total number of parameters. More... | |
| int | output_size () const |
| Output dimension of the last layer. More... | |
| CudaScalar * | params_data () |
| Mutable device pointer to parameters. More... | |
| CudaScalar * | grads_data () |
| Mutable device pointer to gradients. More... | |
| void | zeroGrads () |
| Zero all gradients. More... | |
| void | forward_only (const CudaScalar *input, int batch) |
| Forward pass only (no gradient computation) More... | |
| CudaScalar | compute_loss_and_grad (const CudaScalar *input, const CudaScalar *target, int batch) |
| Compute MSE loss and gradients for a batch. More... | |
| void | copy_output_to_host (CudaScalar *host, size_t n) const |
| Copy the latest output activations to host memory. More... | |
| int | last_batch () const |
| Batch size used in the last forward pass. More... | |
Feed-forward dense network with GPU-backed parameters and gradients.
|
inlineexplicit |
Construct a network tied to a cuBLAS handle.
|
inline |
Append a layer definition.
| in | Input dimension |
| out | Output dimension |
| act | Activation function |
|
inline |
Allocate parameter/gradient buffers and initialize weights.
| seed | RNG seed for weight initialization |

|
inline |
Compute MSE loss and gradients for a batch.
| input | Input batch (in x batch) |
| target | Target batch (out x batch) |
| batch | Batch size |

|
inline |
Copy the latest output activations to host memory.
|
inline |
Forward pass only (no gradient computation)
| input | Input batch (in x batch) |
| batch | Batch size |

|
inline |
Mutable device pointer to gradients.

|
inline |
Batch size used in the last forward pass.
|
inline |
Output dimension of the last layer.

|
inline |
Mutable device pointer to parameters.

|
inline |
Total number of parameters.
|
inline |
Zero all gradients.

