Giter Club home page Giter Club logo

Comments (9)

exnx avatar exnx commented on September 16, 2024 1

Thank you! Much appreciated!

That's an interesting use case. It would be closer to a generative use case it sounds like, which we haven't supported yet, but plan to explore this in future work.

Hacking the current code for generative tasks shouldn't be super difficult though, and we certainly welcome any contributions!

from hyena-dna.

exnx avatar exnx commented on September 16, 2024 1

yes the weights for the lm_head are there, but the provided loading ckpt code is implemented such that it replaces the lm_head with a new head (scratch) for a downstream task.

If you literally will use the same pretraining model, ie no change to the architecture, then it's even easier, you just pass in the model ckpts using the flag train.pretrained_model_path=path_to_ckpt. This will resume training from the ckpt - you would need to modify code to do inference on some dataset yourself.

Note: this doesn't just give you a DNA generator out of the box. Remember, you're only predicting a single next token given a sequence. If you want to generate a whole new sequence, then you'd have to do this in a loop and prepend 1 token at a time as you decode, which will be relatively slow. There's a whole field dedicated to fast inference and decoding/generating (but we don't support on this repo).

Going to take some hacking :)

You would need to just modify that code.

from hyena-dna.

gonzalobenegas avatar gonzalobenegas commented on September 16, 2024 1

Hi Eric, thank you for the update!

I've been playing since yesterday, after I saw announcements about implementation in HF.

I have a simple Colab notebook to evaluate the (averaged) log-likelihood of a sequence. Does it look correct?

BTW, is it possible there's a small bug when computing the loss? I wonder if it should use self.vocab_size.

from hyena-dna.

thomasopsomer avatar thomasopsomer commented on September 16, 2024

Just to follow on this topic, does the weights on HF also contain the lm_head weights ? And if not could you easily share those weights ? :)

from hyena-dna.

thomasopsomer avatar thomasopsomer commented on September 16, 2024

Alright it's perfect, thanks for clearing that up :)

from hyena-dna.

exnx avatar exnx commented on September 16, 2024

A way to get logits:
https://github.com/HazyResearch/hyena-dna#getting-logits-from-pretrained-model

To clarify though, it's not generating new sequences necessarily from this, it's generating 1 new token at the very end, so you'd to do a for loop to actually generate.

from hyena-dna.

Rocketknight1 avatar Rocketknight1 commented on September 16, 2024

Hi @gonzalobenegas, you're totally right about the bug - my fault, I wrote that part of the port! It should be fixed now.

from hyena-dna.

exnx avatar exnx commented on September 16, 2024

@gonzalobenegas looks good to me!

from hyena-dna.

gonzalobenegas avatar gonzalobenegas commented on September 16, 2024

Great, thank you!

from hyena-dna.

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.