📄 shownet.c
字号:
/**************************************************************************
**************************************************************************
*** ***
*** SHOWNET.C ***
*** ***
*** Notice: ***
*** This code is copyright (C) 1995 by David M. Skapura. It may ***
*** be used as is, or modified to suit the requirements of a ***
*** specific application without permission of the author. ***
*** There are no royalty fees for use of this code, as long ***
*** as the original author is credited as part of the final ***
*** work. In exchange for this royalty free use, the user ***
*** agrees that no guarantee or warantee is given or implied. ***
*** ***
*** ***
**************************************************************************
**************************************************************************/
#include <stdio.h>
void show_weights (layer *layer)
{
float **connects, *wts;
int i, j, incnt, tocnt;
connects = layer->connects;
if (!connects) { printf (" Layer has no connections.\n"); return; }
incnt = layer->inputs;
tocnt = layer->units;
for (i=0; i<tocnt; i++)
{
wts = connects[i];
for (j=0; j<incnt; j++)
{
printf (" Wt[%d][%d] = ", i, j);
if (wts[j] < 0)
printf ("%5.3f", wts[j]);
else
printf (" %5.3f", wts[j]);
}
printf ("\n");
}
}
void show_outputs (layer *layer)
{
int i;
for (i=0; i<layer->units; i++)
if (layer->outputs[i] < 0)
printf (" Out[%d] = %5.3f", i, layer->outputs[i]);
else
printf (" Out[%d] = %5.3f", i, layer->outputs[i]);
printf ("\n");
}
void show_targets (float *t, int how_many)
{
int i;
for (i=0; i<how_many; i++)
if (t[i] < 0) printf (" SB[%d] = %5.3f", i, t[i]);
else printf (" SB[%d] = %5.3f", i, t[i]);
printf ("\n");
}
#ifdef BPN
void show_errors (layer *l)
{
int i;
for (i=0; i<l->units; i++)
if (l->errors[i] < 0) printf (" Err[%d] = %5.3f", i, l->errors[i]);
else printf (" Err[%d] = %5.3f", i, l->errors[i]);
printf ("\n");
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -