Skip to content

Instantly share code, notes, and snippets.

@nelsonaloysio
nelsonaloysio / clustering.py
Created February 13, 2024 15:13 — forked from wzjoriv/clustering.py
Nearest Neighbor, K Nearest Neighbor and K Means (NN, KNN, KMeans) implemented only using PyTorch
import torch as th
"""
Author: Josue N Rivera (github.com/wzjoriv)
Date: 7/3/2021
Description: Snippet of various clustering implementations only using PyTorch
Full project repository: https://github.com/wzjoriv/Lign (A graph deep learning framework that works alongside PyTorch)
"""
def random_sample(tensor, k):
@nelsonaloysio
nelsonaloysio / hex.sh
Last active January 10, 2024 21:04 — forked from nberlette/hex.sh
[bash] rgb to hex
hex() { bash -c """printf "%02X%02X%02X" $(echo $* | tr , \ )"""; }
@nelsonaloysio
nelsonaloysio / flatpak install
Created January 2, 2024 21:14 — forked from user5145/flatpak install
how to build, install and remove flatpak applications from cli
1. Store in a repository
flatpak-builder --force-clean build-dir --repo=/path/to/local/repo your.application.Client.yml
2. Install from the repository
flatpak --user install localrepo your.application.Client
3. Install the repository
flatpak --user remote-add --no-gpg-verify local-repo /path/to/repo
4. Store in a folder