Skip to content

Instantly share code, notes, and snippets.

View scottjmaddox's full-sized avatar

Scott J Maddox scottjmaddox

View GitHub Profile
@scottjmaddox
scottjmaddox / lru_jax.py
Created April 19, 2023 05:17
JAX implementation of the Linear Recurrent Unit (LRU) layer
"""
The JAX implementation of the Linear Recurrent Unit (LRU) layer, from the paper
"Resurrecting Recurrent Neural Networks for Long Sequences".
http://arxiv.org/abs/2303.06349
"""
import jax
import jax.numpy as jnp
import numpy as np
parallel_scan = jax.lax.associative_scan

Me:

How do encoder-only NLP models differ from encoder-decoder models?

ChatGPT:

Encoder-only models are a type of natural language processing (NLP) model that only have an encoder component, whereas encoder-decoder models have both an encoder and a decoder component. The encoder is responsible for converting the input text into a compact representation, or encoding, that captures the essential information in the input. The decoder then takes this encoding and generates the output text based on it.

Encoder-only models are typically used for tasks where the input and output are the same, such as language translation or summarization. In these tasks, the encoder takes the input text and creates an encoding that captures the meaning of the text, and the decoder then uses this encoding to generate the output text.

-- Copyright (c) 2020 Scott J Maddox
--
-- Licensed under either the Apache License, Version 2.0
-- (see https://www.apache.org/licenses/LICENSE-2.0),
-- or the ZLib license (see https://opensource.org/licenses/Zlib),
-- at your option.
module Data.BinOpTree
( BinOpTree (..),
allFromList,