/
sigmoidn.m
executable file
·32 lines (32 loc) · 2.01 KB
/
sigmoidn.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% ============================================================================%
% PHAX- initialize weights and do backprop %
% %
% Arash Fayyazi and Mohammad Ansari %
% Low-Power High-Performance Nanosystems Laboratory, Tehran %
% SPORT Lab, University of Southern California, Los Angeles, CA 90089 %
% http://nanolab.ut.ac.ir/ %
% http://sportlab.usc.edu/ %
% %
% These models may be freely copied and used for research purposes under %
% the BSD 3-Clause License. %
% %
% %
% Please cite following paper: %
% M. Ansari et al., "PHAX: Physical Characteristics AwareEx-SituTraining %
% Framework for Inverter-Based Memristive Neuromorphic Circuits," in IEEE %
% Transactions on Computer-Aided Design of Integrated Circuits and Systems, %
% vol. 37, no. 8, pp. 1602-1613, Aug. 2018. doi: 10.1109/TCAD.2017.2764070 %
% %
% %
% ============================================================================%
function g = sigmoidn(z, sharp_factorn, Vdd)
%SIGMOID Compute sigmoid functoon
% J = SIGMOID(z) computes the sigmoid of z.
%g = 1.0 ./ (1.0 + exp(-z));
% g = (1/2) * ((2.0 ./ (1.0 + exp(-z)))-1);
global cc2;
g = (Vdd / 2) * tansig(sharp_factorn*(z-cc2(3)));
% global my_coeffs;
% cc = my_coeffs;
% g = cc(1)+cc(2)*tanh((z-cc(3))*cc(4));
end