yabata / pyrenn

A Recurrent Neural Network Toolbox for Python and Matlab
GNU General Public License v3.0
99 stars 42 forks source link

How to extract Weights, bias from trained model, and how to choose a error function ? #10

Open automataIA opened 4 years ago

automataIA commented 4 years ago
  1. How to extract Weights and bias from trained model?
  2. How to set, or choose a error function for model?

im using the same code in the example:

 IMPORT DATASET -----------------------------------
X = pd.read_feather('Input.file') ; 
Y = pd.read_feather('Target.file') ;

TRASFORMATION DATASET IN ARRAY -------------------
X = X.values.T
Y = Y.values.T
print(X.shape,Y.shape)
 NETWORK ------------------------------
net = prn.CreateNN([3,6,8])

net = prn.train_LM(X,Y,net,verbose=True,k_max=1000,E_stop=1e-5)

ADD : why with command :

W0 = net['w0']; print(W0.shape) ;
W1 = net['w']; print(W1.shape) ; 
  1. give me a shape for W0 and W1 of [80,] and not : [6x3] and [8x6] ?
  2. and normP and normY are bias, i think?
yabata commented 4 years ago

HI Zawarud,

you can save weights as descibed here:

https://pyrenn.readthedocs.io/en/latest/save.html

Pyrenn only supports tanh as transfer function.

Best regards

Dennis

Von: Zawarud [mailto:notifications@github.com] Gesendet: Mittwoch, 29. Januar 2020 15:26 An: yabata/pyrenn pyrenn@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Betreff: [yabata/pyrenn] How to extract Weights, bias from trained model, and how to choose a error function ? (#10)

  1. How to extract Weights and bias from trained model?
  2. How to set, or choose a error function for model?

im using the same code in the example: `# IMPORT DATASET ----------------------------------- X = pd.read_feather('Input.file') ; Y = pd.read_feather('Target.file') ;

TRASFORMATION DATASET IN ARRAY -------------------

X = X.values.T Y = Y.values.T print(X.shape,Y.shape)

NETWORK ------------------------------

net = prn.CreateNN([3,6,8])

net = prn.train_LM(X,Y,net,verbose=True,k_max=1000,E_stop=1e-5)`

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yabata/pyrenn/issues/10?email_source=notifications&email_token=ACGZMJX4VNLNOPLLTGJ7D6TRAGGYNA5CNFSM4KNFQ34KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IJRSORQ , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGZMJT5RNV3MUABAUNJNK3RAGGYNANCNFSM4KNFQ34A . https://github.com/notifications/beacon/ACGZMJRRG5XIX7DSSLPG44LRAGGYNA5CNFSM4KNFQ34KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IJRSORQ.gif