INGOR
Loading...
Searching...
No Matches
BNDC.h
1/*
2 score/BNDC.{h,c} : BNDC network score function.
3 Copyright (C) 2018-2024 Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 THE FEATURES OF ECv CALCULATION ARE PROTECTED BY PATENT.
7 KYOTO UNIVERSITY HOLDS THE COMMERCIAL RIGHTS TO THIS SOFTWARE.
8 DO NOT COPY, MODIFY OR REDISTRIBUTE WITHOUT PERMISSION.
9
10 See LICENSE.txt for details of the licensing agreement.
11*/
12
13#ifndef __YTLIB_BNDC_H
14#define __YTLIB_BNDC_H
15
16#include "BNRC.h"
17
18#include "util/ytData.h"
19#include "util/ytKeyValues.h"
20#include "net/ytNode.h"
21#include "net/ytEdge.h"
22#include "net/ytNetwork.h"
23
24/* In mega bytes */
25//#define BNDC_DEFAULT_MAX_MEM 500
26#define BNDC_DEFAULT_MAX_MEM 1000
27#define BNDC_DEF {"BNDC",\
28 BNDC_init,\
29 BNDC_score,\
30 BNDC_reinit,\
31 Score_default_cache,\
32 BNDC_edgeProp,\
33 BNDC_nodeProp,\
34 BNDC_finalize,\
35 BNDC_partialResidual,\
36 BNDC_calcEdgeContrib,\
37 BNDC_setEdgeProp,\
38 BNDC_setNodeProp,\
39 BNDC_status,\
40 BNDC_setParam,\
41 }
42
43typedef struct {
44 int * Njmr; /* Njmr[r + m * R]: the number of samples whose value is 'r' with
45 respect to the parent pattern 'm'. */
46 int * Njm; /* Njm[m] = Sum_r Njmr[r + m * R]: */
47 int * pattern; /* pattern[i] represent the parent pattern id of sample 'i' */
48 int * work; /* work area */
49 int total; /* The number of patterns stored in work area */
50} BDE_Data;
51
52void * BNDC_init(ytData * data, ytKeyValues * args);
53void BNDC_reinit(void * buff, ytData * data);
54double BNDC_score(void * buff, const int j, const int * parents, const int q);
55void BNDC_edgeProp(void * buff, const int j, const int * parents, const int q,
56 const int k, ytEdge * edge);
57void BNDC_nodeProp(void * buff, int j, ytNode * node);
58void BNDC_finalize(void * buff);
59void BNDC_partialResidual(void * buff, const int j, const int * parents, const int q,
60 FILE ** fp, double * ll);
61void BNDC_setEdgeProp(void * buff, const int j, const int * parents, const int q,
62 const int k, const ytEdge * edge);
63void BNDC_setNodeProp(void * buff, const int j, const ytNode * node);
64void BNDC_calcEdgeContrib(void * buff, ytNetwork * network, int j, const int * parents, int q,
65 int mode, double * ar);
66void BNDC_status(void * buff);
67int BNDC_debug(int argc, char * argv[]);
68void BNDC_setParam(void * buff, const char * key, ytObject * value);
69
70int BDE_count(const BNRC_Data * D, int j, int n,
71 const int * parents, int q, int R, BDE_Data * B);
72
73void BDE_Data_finalize(BDE_Data * B);
74
75
76#endif /* __YTLIB_BNDC_H */
Network edge.
key-value pairs.
Network abstraction.
The basis class.
Definition BNDC.h:43
Definition BNRC.h:41
General data container.
Definition ytData.h:46
Network node.
Definition ytNode.h:15