Skip to content

Instantly share code, notes, and snippets.

View tarepan's full-sized avatar

tarepan tarepan

View GitHub Profile
@tarepan
tarepan / RandomNoise_with_PyTorch_TensorFlow.ipynb
Last active August 9, 2022 13:35
RandomNoise with PyTorch/TensorFlow
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tarepan
tarepan / emb_learn.ipynb
Last active August 9, 2022 13:33
Emb_learn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tarepan
tarepan / lstm_layer_cell_onnx.ipynb
Created June 7, 2022 14:27
LSTM_layer_cell_ONNX.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tarepan
tarepan / comparision_audio_read.ipynb
Created November 19, 2021 07:03
Comparision_audio_read.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tarepan
tarepan / gru.py
Created June 17, 2021 10:41
PyTorch tips: h_0=None in GRU
# ================================= tips ===================================
# In PyTorch's GRU, "no h_0 argument" == `h_0=None` == "h_0 is zeros"
# ==========================================================================
from torch.nn import GRU
from torch import tensor
gru = GRU(3, 3, batch_first=True)
i = tensor([[[1., 2., 3.]]])
h = tensor([[[0., 0., 0.]]])
@tarepan
tarepan / preemphasis.py
Last active June 7, 2021 22:46
Preemphasis / Noise shaping
# Audio Preemphasis/Deemphasis in Notebook.
# You can hear the audio see spectrograms.
!pip install librosa>=0.8.1
import IPython
from IPython.display import display, Audio
import numpy as np
import librosa
import librosa.display
@tarepan
tarepan / reproyae.ipynb
Created August 4, 2019 12:16
reproYAE.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tarepan
tarepan / random_sampling_pytorch.ipynb
Last active July 26, 2019 11:42
random_sampling_PyTorch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tarepan
tarepan / lj_send.py
Created March 18, 2019 16:07
LabJack U3 bit-series output with LabJackPython
import u3
d = u3.U3() # try automatic open
d.configIO(FIOAnalog = 0, EIOAnalog = 0) # set all fio digital # https://github.com/labjack/LabJackPython/blob/1399afafef4e29d7081e223b0ecac98d7bdd67a4/src/u3.py#L336
def send3bit(fio_No: int, bits: [int]):
"""Send 3-bit big endian message
Arguments:
fio_No -- LabJack U3's flexible IO port number. e.g: [0,0,1] (==1)
bits -- message with 3-bit big endian
@tarepan
tarepan / cupy_on_colab.ipynb
Created November 17, 2018 09:00
CuPy_on_Colab.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.