gbits.cpp
来自「一个由Mike Gashler完成的机器学习方面的includes neural」· C++ 代码 · 共 16 行
CPP
16 行
#include "GBits.h"#include <math.h>// staticdouble GBits::GetRandomGaussian(){ double x, y, mag; do { x = GBits::GetRandomDouble() * 2 - 1; y = GBits::GetRandomDouble() * 2 - 1; mag = x * x + y * y; } while(mag >= 1.0 || mag == 0); return y * sqrt(-2.0 * log(mag) / mag); // the Box-Muller transform }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?