CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Extracting Weights from trained model

Open bencherian opened this issue 10 years ago • 2 comments

Is there a straightforward (or even not so straightforward) way of extracting the weights from a trained network? For example if I were to train an MLP with a single hidden layer (constructed as below) how would I go about extracting the weights associated with the Dense layer and the linear layer when I only have access to network

def create_network(input_var, num_hn):
    h = Dense(num_hn, activation=tanh)(input_var)
    network = linear_layer(h, 1) # linear_layer defined from example code

bencherian avatar Oct 30 '16 00:10 bencherian

Look at cell [5] in this tutorial https://github.com/Microsoft/CNTK/blob/master/bindings/python/tutorials/CNTK_202_Language_Understanding.ipynb

n17s avatar Nov 03 '16 05:11 n17s

The tutorial moved to this url: https://github.com/Microsoft/CNTK/blob/master/Tutorials/CNTK_202_Language_Understanding.ipynb

chrisbasoglu avatar Nov 15 '16 02:11 chrisbasoglu