- New image density model based on PixelCNN
- Can generate variety of images from text embeddings or CNN layer weights
- Serves as decoder in image autoencoder
- Gated PixelCNN: Matches PixelRNN accuracy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Train a neural network to learn an FIR filter. | |
| Created on Fri Aug 3 15:00:40 2018 | |
| """ | |
| from tensorflow.keras.models import Sequential | |
| from tensorflow.keras.layers import Dense | |
| from tensorflow.keras.callbacks import Callback | |
| import numpy as np | |
| from scipy import signal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) 2021 Francesco Mazzoli <f@mazzo.li> | |
| // | |
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding:UTF-8 -*- | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.init as init | |
| def weight_init(m): | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import audio_io | |
| import numpy | |
| audio1, _ = audio_io.ReadWavFile('voice_nodelay.wav') | |
| audio1 = audio1.ravel() | |
| audio2, _ = audio_io.ReadWavFile('voice_mic_blend3.wav') | |
| audio2 = audio2.ravel() | |
| # Truncate all signals same length, then pad to avoid boundary effects. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Weight norm is now added to pytorch as a pre-hook, so use that instead :) | |
| import torch | |
| import torch.nn as nn | |
| from torch.nn import Parameter | |
| from functools import wraps | |
| class WeightNorm(nn.Module): | |
| append_g = '_g' | |
| append_v = '_v' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # recursively removes all .pyc files and __pycache__ directories in the current | |
| # directory | |
| find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf |
NewerOlder