reg_data: Function to compute the regularized version of COSNet (Frasca...

Description Usage Arguments Value References Examples

View source: R/reg_data.R

Description

This function modifies the weights and the thresholds of the network to realized the COSNet regularization.

Usage

1
reg_data(W, theta, eta, M, m, pos_num)

Arguments

W

square symmetric named matrix of the network weights. The components of W are in the [0,1] interval. The i,j-th component is the weight between neuron i and neuron j. The components of the diagonal of W are 0

theta

vector of the neuron activation thresholds

eta

real value corresponding to the eta regularization coefficient in the energy function (Frasca et al. 2013). If eta = 0 no regularization is applied. The higher the value of eta, the more the influence of the regularization term

M

positive neuron activation value

m

negative neuron activation value

pos_num

number of expected positive neurons in the equilibrium state of the network

Value

list of two element:

W

the regularized connection matrix

theta

regularized threshold vector

References

Frasca M., Bertoni A., Re M., Valentini G.: A neural network algorithm for semi-supervised node label learning from unbalanced data. Neural Networks, Volume 43, July, 2013 Pages 84-98.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(bionetdata);
data(Yeast.STRING.data);
n <- nrow(Yeast.STRING.data);
dim(Yeast.STRING.data);
range(Yeast.STRING.data);
## setting values for parameter alpha, for the rate of positive examples,
## for neuron thresholds and for eta parameter
alpha <- 1;
pos.rate <- 0.01;
thresholds <- runif(n);
range(thresholds);
eta <- 0.001;
a <- reg_data(Yeast.STRING.data, thresholds, eta, sin(alpha),
    -cos(alpha), ceiling(pos.rate*n));
## new connection matrix
dim(a$W);
range(a$W);
## new thresholds
range(a$theta);

COSNet documentation built on Nov. 8, 2020, 8:12 p.m.