FullyConnectedParams
#include <popsparse/FullyConnectedParams.hpp>
Parameters used for fully-connected layers using sparse tensors.
-
namespace popsparse
Support for sparse matrices.
-
namespace dynamic
Support for dynamic sparse matrices.
Functions
-
std::ostream &operator<<(std::ostream &os, const FullyConnectedParams &p)
-
class FullyConnectedParams
Fully connected parameters
These are the parameters which define a fully connected layer.
Matrix multiplications for the different passes are as follows
For pass =
FC_INFERENCEorFC_TRAINING_FWD[
numGroups][outputChannelsPerGroup][inputChannelsPerGroup] * [numGroups][inputChannelsPerGroup][batchSize]For pass =
FC_TRAINING_GRADA[
numGroups][inputChannelsPerGroup][outputChannelsPerGroup] * [numGroups][outputChannelsPerGroup][batchSize]For pass =
FC_TRAINING_GRADW[
numGroups][outputChannelsPerGroup][batchSize] * [numGroups][batchSize][inputChannelsPerGroup]
-
static FullyConnectedParams createWithNzRatio(const SparsityParams &sparsityParams, double nzRatio, std::size_t batchSize, std::size_t numGroups, std::size_t inputChannels, std::size_t outputChannels)
Create parameters with the specified ratio of non-zero elements.
-
static FullyConnectedParams createWithNumNonZeroValues(const SparsityParams &sparsityParams, std::size_t numNonZeroElems, std::size_t batchSize, std::size_t numGroups, std::size_t inputChannels, std::size_t outputChannels)
Create parameters with the specified number of non-zero elements.
Private Members
-
SparsityParams sparsityParams
Sparsity parameters.
-
double nzRatio
Proportion of weights which are non-zero in range [0,1].
Friends
-
friend bool operator<(const FullyConnectedParams &a, const FullyConnectedParams &b)
-
friend bool operator==(const FullyConnectedParams &a, const FullyConnectedParams &b)
-
friend bool operator!=(const FullyConnectedParams &a, const FullyConnectedParams &b)
-
std::ostream &operator<<(std::ostream &os, const FullyConnectedParams &p)
-
namespace dynamic