⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decaycounter.h

📁 The library is a C++/Python implementation of the variational building block framework introduced in
💻 H
字号:
// -*- C++ -*-//// This file is a part of the Bayes Blocks library//// Copyright (C) 2001-2006 Markus Harva, Antti Honkela, Alexander// Ilin, Tapani Raiko, Harri Valpola and Tomas 謘tman.//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2, or (at your option)// any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License (included in file License.txt in the// program package) for more details.//// $Id: DecayCounter.h 5 2006-10-26 09:44:54Z ah $#ifndef DECAYCOUNTER_H#define DECAYCOUNTER_H#include "Templates.h"#include "Saver.h"#include "Loader.h"class DecayCounter{public:  static DecayCounter *GlobalLoader(NetLoader *loader);  virtual ~DecayCounter() {}  virtual void Load(NetLoader *loader) = 0;  virtual void Save(NetSaver *saver) = 0;  virtual double StepTime() = 0;  virtual double GetDecay() = 0;};class TraditionalDecayCounter : public DecayCounter{public:  TraditionalDecayCounter(double r = 0.5);  virtual void Save(NetSaver *saver);  virtual void Load(NetLoader *loader);  virtual double StepTime();  virtual double GetDecay() { return decay; }  double samples, cumsum, ratio, decay;};#ifdef WITH_PYTHON#ifndef __PYTHON_H_INCLUDED__#error "Python.h must be included before this file.  (It must also be included before any system include files.)"#endif // not __PYTHON_H_INCLUDEDclass PythonDecayCounter : public DecayCounter{public:  PythonDecayCounter(PyObject *step_function);  virtual ~PythonDecayCounter();  virtual void Save(NetSaver *saver);  virtual void Load(NetLoader *loader);  virtual double StepTime();  virtual double GetDecay() { return decay; }  double decay;  PyObject *step_function;};#endif  // WITH_PYTHON#endif // DECAYCOUNTER_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -