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
| # coding: utf-8 | |
| from __future__ import division | |
| import time, chainer, argparse, sys | |
| import fft, config | |
| import numpy as np | |
| from chainer import cuda | |
| import alsaaudio, pyaudio | |
| from multiprocessing import Process, Queue | |
| from model import load_model |
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
| from __future__ import division | |
| from __future__ import print_function | |
| import argparse, chainer, time, sys | |
| import numpy as np | |
| import chainer.functions as F | |
| from chainer import cuda | |
| from model import Model | |
| from aae.optim import Optimizer, GradientClipping | |
| from aae.utils import onehot, printr, clear_console | |
| from aae.dataset.semi_supervised import Dataset |
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 chainer | |
| import numpy as np | |
| train, test = chainer.datasets.get_mnist() | |
| dataset = train._datasets[0] * 10 - 5 | |
| num_data = dataset.shape[0] | |
| def calculate_parameter(): | |
| mean = np.mean(dataset, axis=0) |
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 re | |
| text = "BASIC_LATIN U+0000 U+007F (128)\n" \ | |
| "LATIN_1_SUPPLEMENT U+0080 U+00FF (128)\n" \ | |
| "LATIN_EXTENDED_A U+0100 U+017F (128)\n" \ | |
| "LATIN_EXTENDED_B U+0180 U+024F (208)\n" \ | |
| "IPA_EXTENSIONS U+0250 U+02AF (96)\n" \ | |
| "SPACING_MODIFIER_LETTERS U+02B0 U+02FF (80)\n" \ | |
| "COMBINING_DIACRITICAL_MARKS U+0300 U+036F (112)\n" \ | |
| "GREEK_AND_COPTIC U+0370 U+03FF (135)\n" \ |
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
| # encoding: utf-8 | |
| import numpy as np | |
| import chainer | |
| import chainer.links as L | |
| import chainer.functions as F | |
| from chainer import cuda, optimizers | |
| from chainer.optimizer import GradientClipping, WeightDecay | |
| class Model(chainer.Chain): | |
| def __init__(self): |
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
| # encoding: utf-8 | |
| from __future__ import division | |
| from __future__ import print_function | |
| import numpy as np | |
| import chainer.links as L | |
| from chainer import cuda | |
| def test_linear(): | |
| np.set_printoptions(precision=32) | |
| xp = cuda.cupy |
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 math | |
| import numpy as np | |
| batchsize = 2 | |
| r = 2 | |
| out_channels = 3 | |
| in_channels = r ** 2 * out_channels | |
| in_height = 3 | |
| in_width = 3 | |
| out_height = in_height * r |
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
| # coding: utf-8 | |
| import numpy as np | |
| import math | |
| def compute_log_likelihood(x, mean, stddev): | |
| return math.log(1 / (stddev * math.sqrt(2.0 * math.pi))) - (x - mean) ** 2 / (2.0 * stddev ** 2) | |
| def main(): | |
| prior_mean = 2.5 | |
| prior_stddev = 0.15 |
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
| # -*- coding: utf-8 -*- | |
| import math | |
| import json, os, sys | |
| from args import args | |
| from chainer import cuda | |
| sys.path.append(os.path.split(os.getcwd())[0]) | |
| from gan import GAN, DiscriminatorParams, GeneratorParams | |
| from sequential import Sequential | |
| from sequential.layers import Linear, BatchNormalization, Deconvolution2D, Convolution2D | |
| from sequential.functions import Activation, dropout, gaussian_noise, tanh, sigmoid, reshape |