2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __SOUSCHEF_DATA_GAUSSIAN_H__
18 #define __SOUSCHEF_DATA_GAUSSIAN_H__
20 #include "souschef/DataChef.h"
26 * @brief Generate a sequence of random values according to the gaussian(=normal) distribution
28 class GaussianFloat32DataChef final : public DataChef
31 GaussianFloat32DataChef(float mean, float stddev) : _mean{mean}, _stddev{stddev}
37 std::vector<uint8_t> generate(int32_t count) const override;
44 class GaussianFloat16DataChef final : public DataChef
47 GaussianFloat16DataChef(float mean, float stddev) : _mean{mean}, _stddev{stddev}
53 std::vector<uint8_t> generate(int32_t count) const override;
60 class GaussianInt32DataChef final : public DataChef
63 GaussianInt32DataChef(float mean, float stddev) : _mean{mean}, _stddev{stddev}
69 std::vector<uint8_t> generate(int32_t count) const override;
76 class GaussianInt16DataChef final : public DataChef
79 GaussianInt16DataChef(float mean, float stddev) : _mean{mean}, _stddev{stddev}
85 std::vector<uint8_t> generate(int32_t count) const override;
92 class GaussianUint8DataChef final : public DataChef
95 GaussianUint8DataChef(float mean, float stddev) : _mean{mean}, _stddev{stddev}
101 std::vector<uint8_t> generate(int32_t count) const override;
108 class GaussianInt8DataChef final : public DataChef
111 GaussianInt8DataChef(float mean, float stddev) : _mean{mean}, _stddev{stddev}
117 std::vector<uint8_t> generate(int32_t count) const override;
124 struct GaussianFloat32DataChefFactory : public DataChefFactory
126 std::unique_ptr<DataChef> create(const Arguments &args) const;
129 struct GaussianInt32DataChefFactory : public DataChefFactory
131 std::unique_ptr<DataChef> create(const Arguments &args) const;
134 struct GaussianInt16DataChefFactory : public DataChefFactory
136 std::unique_ptr<DataChef> create(const Arguments &args) const;
139 struct GaussianUint8DataChefFactory : public DataChefFactory
141 std::unique_ptr<DataChef> create(const Arguments &args) const;
144 struct GaussianFloat16DataChefFactory : public DataChefFactory
146 std::unique_ptr<DataChef> create(const Arguments &args) const;
149 struct GaussianInt8DataChefFactory : public DataChefFactory
151 std::unique_ptr<DataChef> create(const Arguments &args) const;
154 } // namespace souschef
156 #endif // __SOUSCHEF_DATA_GAUSSIAN_H__