Skip to content

Instantly share code, notes, and snippets.

View SynthAether's full-sized avatar

Zyser SynthAether

View GitHub Profile
@SynthAether
SynthAether / vectorized-atan2f.cpp
Created December 12, 2023 17:11 — forked from bitonic/vectorized-atan2f.cpp
Vectorized & branchless atan2f
// Copyright (c) 2021 Francesco Mazzoli <[email protected]>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@SynthAether
SynthAether / clean_py.sh
Created June 29, 2022 18:21 — forked from luzfcb/clean_py.sh
Recursively removes all .pyc files and __pycache__ directories in the current directory
#!/bin/sh
# recursively removes all .pyc , .pyo files and __pycache__ directories in the current
# directory
find . | \
grep -E "(__pycache__|\.pyc$|\.pyo$)" | \
xargs rm -rf
# or, for copy-pasting:
@SynthAether
SynthAether / persistent.cpp
Created September 29, 2019 07:15 — forked from guozhou/persistent.cpp
A minimum CUDA persistent thread example.
#include <iostream>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
// GTS450 sm_21
#define NUM_SM 4 // no. of streaming multiprocessors
#define NUM_WARP_PER_SM 48 // maximum no. of resident warps per SM
#define NUM_BLOCK_PER_SM 8 // maximum no. of resident blocks per SM
#define NUM_BLOCK NUM_SM * NUM_BLOCK_PER_SM
#define NUM_WARP_PER_BLOCK NUM_WARP_PER_SM / NUM_BLOCK_PER_SM
@SynthAether
SynthAether / check_model_at_cpy.ipynb
Created February 8, 2019 12:48 — forked from melgor/check_model_at_cpy.ipynb
How to restore CUDNNLSTM of TensorFlow at CPU device? So that it could be used in GPU, CPU or Mobile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SynthAether
SynthAether / min-char-rnn.py
Created January 2, 2019 07:40 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@SynthAether
SynthAether / gru.py
Created December 26, 2018 14:29 — forked from danijar/gru.py
Gated Recurrent Unit with Layer norm and Xavier initializer
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
class GRU(tf.contrib.rnn.RNNCell):