-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model Saving #159
Comments
Use pickle or cpickle (Python modules for serializing objects ) to store the generated model |
This allows me to save the SdA object, but I would like to input vectors and retrieve their encoding, or "h(x)" in the literature, where "x" is the input. |
You can try something like:
|
Thanks for your help, another question is that what does [index] mean in your code?^-^ At 2016-09-22 08:22:24, "Alison Marczewski" [email protected] wrote: You can try something like: def new_representation_X_train(hidden_layer): — |
Oh, I get it and I have added it to the DBN class. Thank you again. At 2016-09-22 08:22:24, "Alison Marczewski" [email protected] wrote: You can try something like: def new_representation_X_train(hidden_layer): — |
@ohuole233 remember this value comes from a sigmoid function. If you want the linear output, you need to create a |
@amarczew Hi.professor~ After the method new_representation_X_train added in the class DBN,and I run the code like this: import theano pretraining_epochs=2 train_set=[[1,2,3,1],[2,3,1,4],[3,6,4,2],[3,5,4,5],[4,2,5,2],[4,3,2,6]] dbn=DBN.DBN(numpy_rng=numpy_rng,n_ins=4,hidden_layers_sizes=[3,3],n_outs=2) print dbn.new_representation_X_train(2) An unexpected bug occured to remind me that "TypeError: new_representation_X_train() takes exactly 1 argument (2 given)". |
@ohuole233 probably the problem is related to |
Grateful for your reply. but it seems 'global name 'index' is not defined. I haven't got how to define it and my objective is to derive new representation for each input.Waiting for your assistance sincerely . 发自网易邮箱大师 @ohuole233 probably the problem is related to self parameter that is passed implicitly, because you are calling a function from an object. Change to def new_representation_X_train(self, hidden_layer): may fix it. — |
@ohuole233 you need to declare this tensor |
@amarczew Hi, Professor. I have abandoned training on GUPs with some special settlements. However, after the above repair including declaring the tensor and adding self, a new error named '' NameError: global name 'train_set_x' is not defined '' occurred. Is there anything to fix the bug? |
@ohuole233 Unfortunately I don't have this implementation. This function is working on SdA.py implementation. You can take a look on this file to solve the problem in your DBN implementation. I have declared this function inside |
I am using the file SdA.py. I am wondering if there is a way to save the model which has been generated and trained; I would like to run vectors through the network and get back the "encoding" from the trained network.
The text was updated successfully, but these errors were encountered: