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 <torch/torch.h> | |
| #include <torch/script.h> | |
| struct Bottleneck : torch::nn::Module { | |
| torch::nn::Conv2d _conv1; | |
| torch::nn::BatchNorm2d _bn1; | |
| torch::nn::Conv2d _conv2; | |
| torch::nn::BatchNorm2d _bn2; | |
| torch::nn::Conv2d _conv3; | |
| torch::nn::BatchNorm2d _bn3; |
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
| open System.Runtime.InteropServices | |
| open NAudio.CoreAudioApi | |
| module NativeMethods = | |
| [<DllImport("api-ms-win-core-synch-l1-2-0.dll")>] | |
| extern System.IntPtr CreateEvent(System.IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, System.IntPtr lpName) | |
| [<DllImport("api-ms-win-core-handle-l1-1-0.dll")>] | |
| extern bool CloseHandle(System.IntPtr hObject) |
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 numpy as np | |
| def sfft(x): | |
| n = len(x) | |
| if n==1: | |
| return x | |
| elif n==2: | |
| return np.r_[x[0]+x[1], x[0]-x[1]] | |
| else: | |
| w = np.exp(-2j*np.pi/n*np.arange(n//4)) | |
| w3 = np.exp(-2j*np.pi/n*3*np.arange(n//4)) |
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
| /* | |
| * wasapi_capture_and_render.cpp | |
| * | |
| * Created by fukuroda (https://github.com/fukuroder) | |
| */ | |
| // STL | |
| #include <iostream> | |
| #include <vector> |
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
| cutoff = hslider("[0]cutoff", 200, 20, 2000, 0.1); | |
| resonance = hslider("[1]resonance", 0.707, 0.707, 20, 0.01); | |
| low = hslider("[2]low", 1.0, 0.0, 1.0, 0.01); | |
| band = hslider("[3]band", 1.0, 0.0, 1.0, 0.01); | |
| high = hslider("[4]high", 1.0, 0.0, 1.0, 0.01); | |
| pi = 3.141592; | |
| s = tan( cutoff * pi / 44100.0 ); | |
| t = s / resonance; | |
| u = s*s + t + 1.0; | |
| a0 = (low*s*s + band*t + high)/u; |
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
| name: "mnist_train1" | |
| layer { | |
| name: "mnist" | |
| type: "Data" | |
| top: "data" | |
| top: "label" | |
| include { | |
| phase: TRAIN | |
| } | |
| transform_param { |
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 os | |
| import cv2 | |
| import numpy as np | |
| train_image = 'train-images-idx3-ubyte' | |
| train_label = 'train-labels-idx1-ubyte' | |
| test_image = 't10k-images-idx3-ubyte' | |
| test_label = 't10k-labels-idx1-ubyte' | |
| for f in [train_image, train_label, test_image, test_label]: |
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
| \begin{eqnarray} | |
| A_{2k} &=& \sum_{j=0}^{N/2-1} (a_j + a_{N/2+j}) W_{N/2}^{jk} \\ | |
| A_{2k+1} &=& \sum_{j=0}^{N/2-1} ( a_j - a_{N/2+j}) W_N^j W_{N/2}^{jk} | |
| \end{eqnarray} |
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
| PKG core | |
| PKG alsa | |
| PKG yojson |
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 "../JuceLibraryCode/JuceHeader.h" | |
| std::vector<uint32> Encrypt(const std::string& text, const std::string& key) | |
| { | |
| // create Blowfish | |
| BlowFish bf(key.data(), key.length()); | |
| // encrypt | |
| std::vector<uint32> result; | |
| auto p = text.begin(); |
NewerOlder