Skip to content

Instantly share code, notes, and snippets.

@cigrainger
Created September 4, 2023 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cigrainger/4f2531aa84cd8e1b3593d6c718a4d1ae to your computer and use it in GitHub Desktop.
Save cigrainger/4f2531aa84cd8e1b3593d6c718a4d1ae to your computer and use it in GitHub Desktop.

OOMing Affinity Propagation

Mix.install([
  {:scholar, "~> 0.2.1"},
  {:exla, "~> 0.6.0"}
])

Nx.global_default_backend(EXLA.Backend)

Section

key = Nx.Random.key(42)
{normal, _new_key} = Nx.Random.normal(key, 0, 1, shape: {5868, 1024}, type: :f32)
Scholar.Cluster.AffinityPropagation.fit(normal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment