learn.c

来自「这个代码是policy iteration算法关于强化学习的. 请您用winzi」· C语言 代码 · 共 50 行

C
50
字号


#include <stdlib.h>
#include <stdio.h>
#include <math.h>


#ifdef PGRL_NO_FA
#include "lrn_DirectQ.h"
#endif

#ifdef PGRL_FA
#include "lrn_PIFA.h"
#endif

#include "learn.h"
#include "misc.h"



extern int step;
double **s_hist;
extern double **gauss_center, **gauss_var, **g_hist;
extern int *mode_hist;
extern double *r;


double alpha = 0.01;
double gam = 0.999;

void learn(void)
{
#ifdef PGRL_NO_FA
	PGRL_DirectQ(step, s_hist, g_hist, gauss_center, gauss_var, mode_hist, alpha, gam, r);
#endif
#ifdef PGRL_FA
	PGRL_PIFA(step,s_hist, g_hist, gauss_center, gauss_var, mode_hist, alpha, gam, r);
#endif
}


void Initialize_Learning(void)
{
#ifdef PGRL_NO_FA
	Initialize_PGRL_DirectQ();
#endif
#ifdef PGRL_FA
	Initialize_PGRL_PIFA();
#endif
}

⌨️ 快捷键说明

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