Giter VIP home page Giter VIP logo

Comments (4)

nadavbra avatar nadavbra commented on July 4, 2024

@BiochemStudent2
You can try something along these lines:

from proteinbert import load_pretrained_model

seq = 'MDDADPEERNYDNMLKMLSDLNKDLEKLLEEMEKISVQATWMAYDMVVMRTNPTLAESMRRLEDAFVNCKEEMEKNWQELLHETKQRL'
seq_len = 512

pretrained_model_generator, input_encoder = load_pretrained_model()
X = input_encoder.encode_X([seq], seq_len)
model = pretrained_model_generator.create_model(seq_len)
y_seq, y_annotations = model.predict(X, batch_size = 1)

from protein_bert.

BiochemStudent2 avatar BiochemStudent2 commented on July 4, 2024

Thank you so much! This works great.

from protein_bert.

ZakiaSalod avatar ZakiaSalod commented on July 4, 2024

seq_len

Hi there.

For the seq_len specified in this code, do we have to set the seq_len here, to be the same value as 'seq_len' OR the 'final_seq_len' we used during fine tuning, if we are now trying to use the fine tuned model, to now do predictions based on the fine tuning? As we have the seq_len and final_seq_len as different values. Kindly advise.

from protein_bert.

nadavbra avatar nadavbra commented on July 4, 2024

@ZakiaSalod The model is designed such that it should be quite flexible about seq_len and work reasonably well with different values even without further training of the model (that's in fact one of the motivation of pre-training it with different sequence lengths and fine-tuning it with seq_len and final_seq_len that are different). Having said that, I expect that a seq_len equal to the original seq_len (not final_seq_len) used during fine-tuning may provide slightly better performance. However, if a larger seq_len is called for (e.g. if you need to process longer sequences) don't hesitate to use larger values.

from protein_bert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.