Closed dominikabasaj closed 4 years ago
The code you're referencing doesn't work out of the box for just the LM. To get the hidden layers from the LM, you can use the BiLM.encode() function.
A simple alteration that should get the job done is to replace
z = self.model(c)
in TorchModel.__call__() with
z = self.model.encode(c)
Thanks for your answer! Does that mean that this is the way to obtain sequences encoded by full SSA model? (Although I should probably change saved model to ('ssa_L1_100d_lstm3x512_lm_i512_mb64_tau0.5_p0.05_epoch100.sav')
Yes, that's correct. Setting the full_features argument to False gives only the final SSA embedding. Setting it to True gives the concatenation of all hidden layers as well.
Hi! Thank you for open sourcing your work!
I am trying to encode my protein sequence with your pretrained model according to the procedure you described in the issue: https://github.com/tbepler/protein-sequence-embedding-iclr2019/issues/1, so basically for testing purposes:
an error occurs:
I would be grateful for letting me know what I am doing wrong!