类静态成员数组初始化(包含类中使用枚举)

1 原则,类内声明,类外定义

2.举例

类的定义 包括4个枚举和4个字符串数组

Configure.h

class Configure
{
public:
	enum DataProviderSets
		{
			CIFAR10 = 0,
			MNIST = 1,
		};






	enum LossFunctions
	{
		CrossEntropy = 0,
        LogisticRegression = 1,
		MeanSquareError = 2,
		NegativeLogLikelihood = 3,
	};


	


	enum LayerTypes
	{
		Convolutional = 0,                  
		ConvolutionalSubsampling = 1,      // Patrice Simards layertype
		FullyConnected = 2,
		Input = 3,
		Normalization = 4,
		RBF = 5,
		SoftMax = 6,                       // for logistic regression
		Subsampling = 7,
	};




    enum ActivationFunctions
    {
        AbsTanh = 0,
        AveragePoolingTanh = 1,
        Gaussian = 2,
        Linear = 3,
        Logistics = 4,
        MaxPoolingTanh = 5,
        MedianPoolingTanh = 6,
        None = 7,
        Tanh = 8,
    };


	static std::string DataProviderSets[2]; 


	static std::string LossFunctions[4]; 
	static std::string LayerTypes[8]; 
	static std::string ActivationFunctions[9]; 
	Configure();
	~Configure();
};


Configure.cpp
std::string Configure::DataProviderSets[2] = {"CIFAR10", "MNIST"};
std::string Configure::LossFunctions[4] = {"CrossEntropy", "LogisticRegression","MeanSquareError", "NegativeLogLikelihood"};

std::string Configure::LayerTypes[8] = {"Convolutional","ConvolutionalSubsampling","FullyConnected","Input","Normalization","RBF","SoftMax", "Subsampling"};
std::string Configure::ActivationFunctions[9] = {"AbsTanh","AveragePoolingTanh","Gaussian","Linear","Logistics","MaxPoolingTanh","MedianPoolingTanh","None","Tanh"};



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值