Code Monkey home page Code Monkey logo

Comments (6)

tridao avatar tridao commented on July 17, 2024 1

S4 code has a parameter dt that should be in the range of 1e-3 to 1e-1 (these are hyperparameters that you can change). In Mamba's case we want softplus(x @ weight + dt_bias) to be around that range. We can assume that x @ weight has zero mean at initialization, so we initialize dt_bias so that softplus(dt_bias) is in the range 1e-3 to 1e-1. Ofc this does not guarantee it will stay in this range as the model is trained, but only at initialization.

# Initialize dt bias so that F.softplus(dt_bias) is between dt_min and dt_max

from mamba.

albertfgu avatar albertfgu commented on July 17, 2024
  1. This adds a bias term to ensure $\Delta$ is the right magnitude. See previous SSM papers for details.
  2. This is motivated in the paper; the low-rank factorization saves parameters and is a generalization of a "down projection followed by broadcast"
  3. That's ultimately what happens in spirit

from mamba.

liang00fan avatar liang00fan commented on July 17, 2024

for question1: in my option, it looks like delta is the length of discretization, in order to get the dependent thing, it has to add + $S_\Delta$, but in the paper, it says
image, why remove "Parameter+",it's not the same to the code:dt = self.dt_proj.weight @ dt.t()

from mamba.

tridao avatar tridao commented on July 17, 2024

Parameter here is the dt_bias. Linear(x_t) means self.dt_proj.weight @ dt.t() + dt_bias. In the code we separately do self.dt_proj.weight @ dt.t() and then the dt_bias is added in a separate slep (in the (CUDA kernel).

from mamba.

YicongHong avatar YicongHong commented on July 17, 2024

Hello @tridao @albertfgu, I am very interested in this point as well. Could you please elaborate a bit more on how adding this learnable dt_bias to any input dependent $S_{\Delta}(x_t)$ can ensure the $\Delta$ is at the right magnitude? May I ask which previous SSM paper discussed this?

Much appreciated!

from mamba.

YicongHong avatar YicongHong commented on July 17, 2024

Thanks @tridao so much for your explanation!

from mamba.

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.