Skip to content

Instantly share code, notes, and snippets.

View Ryu1845's full-sized avatar
🎯
Focusing

Sofian Mejjoute Ryu1845

🎯
Focusing
View GitHub Profile
@Ryu1845
Ryu1845 / lru.py
Last active December 13, 2023 13:17
Linear Recurrent Unit (LRU) from the paper ["Resurrecting Recurrent Neural Networks for Long Sequences"](https://arxiv.org/abs/2303.06349)
"""
Simplified Implementation of the Linear Recurrent Unit
------------------------------------------------------
We present here a simplified JAX implementation of the Linear Recurrent Unit (LRU).
The state of the LRU is driven by the input $(u_k)_{k=1}^L$ of sequence length $L$
according to the following formula (and efficiently parallelized using an associative scan):
$x_{k} = \Lambda x_{k-1} +\exp(\gamma^{\log})\odot (B u_{k})$,
and the output is computed at each timestamp $k$ as follows: $y_k = C x_k + D u_k$.
In our code, $B,C$ follow Glorot initialization, with $B$ scaled additionally by a factor 2
to account for halving the state variance by taking the real part of the output projection.
@francois-rozet
francois-rozet / flow_matching.py
Last active March 13, 2025 06:17
Flow Matching in 100 LOC
#!/usr/bin/env python
import math
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from sklearn.datasets import make_moons
from torch import Tensor
from tqdm import tqdm

NICONICO/ニコニコ Community OSINT

Author: EF1500

Introduction

Niconico is like Japanese BiliBili, it is a video hosting platform where users can host videos, create communities and other various activities. Depending on the age of the profile/community, you can discover various information that is crucial to any investigation. However, it may be difficult to pick out information if you are new to OSINT or do not speak the language. This writeup aims to make it easier to find information about Niconico communities/users.

Information you can uncover from Niconico may include:

  • Email Addresses
  • Skype Usernames
  • Friend Usernames/Communities
@crowsonkb
crowsonkb / jax_local_cluster.py
Last active March 7, 2024 11:37
A simple JAX process launcher for multiple devices on a single host.
#!/usr/bin/env python3
"""A simple JAX process launcher for multiple devices on a single host.
You must import jax_local_cluster somewhere inside the script you are launching.
"""
import argparse
from functools import partial
import os
"""
clipbooru.py
Go through a list of (md5).(ext), downloads them from danbooru, and compute CLIP
embeddings. Images are downloaded in parallel while inference is being done, so
this should run as fast as your hardware/network can handle.
"""
# requirements.txt
"""
@DaniruKun
DaniruKun / whisper-transcribe.bash
Last active November 7, 2024 07:15
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@harubaru
harubaru / wd1-3-release.md
Last active April 16, 2025 14:17
Official Release Notes for Waifu Diffusion 1.3

Waifu Diffusion 1.4 Overview

An image generated at resolution 512x512 then upscaled to 1024x1024 with Waifu Diffusion 1.3 Epoch 7.

Goals

  • Improving image generation at different aspect ratios using conditional masking during training. This will allow for the entire image to be seen during training instead of center cropped images, which will allow for better results when generating full body images, portraits, and improving the composition.
  • Expanded the input context from 77 tokens to 231 tokens or perhaps to an unlimited amount of tokens. Out of 77 tokens for input, only 75 are useable. This does not give nearly enough room for complex prompting that requires a lot of detail.
@kermit4977
kermit4977 / get_embeddings.py
Last active July 29, 2023 20:42
Python script to get SD embeddings from the Stable Diffusion Textual Inversion Concepts Library for use with SD WebUI
#!/bin/python
####
# Designed for use with https://github.com/AUTOMATIC1111/stable-diffusion-webui
# Run this file from the root of the repo
#
# Usage in prompt: Put embedding name in prompt (using moxxi.pt and borderlands.pt)
# e.g. moxxi on a beach, in the style of borderlands sharp, clear lines, detailed
# or
# e.g. <moxxi> on a beach, in the style of <borderlands> sharp, clear lines, detailed