This file contains 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
close all; | |
clear all; | |
% load the protein dataset, this is a array of struct that has fields .pssm and .ss | |
% which are our features and labels respectively. pssm is a L by 20 array of features. | |
% ss is a L by 1 array of characters C, E, H or X which are our 4 classes. | |
% the actual variable that appears is called 'combined' | |
load protein_dataset; | |
% this is the name of the HDF5 file we will be writing to | |
fname = ['proteins_train_currennt.nc']; |
This file contains 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
# The train/test net protocol buffer definition | |
net: "./iris_caffe_network.prototxt" | |
# test_iter specifies how many forward passes the test should carry out. | |
# In the case of iris, we have test batch size 10 (specified in iris_network.prototxt) | |
# and 5 test iterations covering the full 50 test vectors. | |
test_iter: 5 | |
# Carry out testing every 500 training iterations. | |
test_interval: 100 | |
# The base learning rate, momentum and the weight decay of the network. | |
base_lr: 0.001 |
This file contains 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: "iris" | |
layer { | |
name: "data" | |
type: "HDF5Data" | |
top: "data" | |
top: "label" | |
include: { | |
phase: TRAIN | |
} | |
hdf5_data_param { |
This file contains 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
% load the dataset, this is built in to matlab | |
load fisheriris | |
% the data is ordered, we want to randomly select 100 points for train, 50 | |
% for test. This part just generates a random list of array indices. | |
indices = randperm(150); | |
train_indices = indices(1:100); | |
test_indices = indices(101:end); | |
% meas contains the features, we use our random indices to select a subset |
This file contains 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
XUKEXWSLZJUAXUNKIGWFSOZRAWURORKXAOSLHROBXBTKCMUWDVPTFBLMKEFVWMUXTVTWUIDDJVZKBRMCWOIWYDXMLUFPVSHAGSVWUFWORCWUIDUJCNVTTBERTUNOJUZHVTWKORSVRZSVVFSQXOCMUWPYTRLGBMCYPOJCLRIYTVFCCMUWUFPOXCNMCIWMSKPXEDLYIQKDJWIWCJUMVRCJUMVRKXWURKPSEEIWZVXULEIOETOOFWKBIUXPXUGOWLFPWUSCH | |
XRFMTOUWLUKVLBCWCEKXWUEMUJIEAMFRUFUOXOUPTWPMEWSXVUPOVTSLTSNYXROLHVHOTCCOZRTAJRNJFJOWGULMUWUBUSZGCMKAXIVHBIVBXBDWVMWRIUTDUTCMKUNKJFWYSXXKCVWKPKWPIMZOOOPUXGUKRRJXRUWWBCSCEKGFDRWVLDPOSVMURRLSWOPCIZIYELZTWDSYIEFRFOUVTQIPABIJVVKWWWLWCFFDZUUMYNSCJVSRKDVQCWXCOEXTXMIUH | |
HCSUWPFLWOGUXPXUIBKWFOOTEOIELUXVZWIEESPKRUWXKRVMUJCRVMUJCWIWJDKQIYLDEXPKSMWICMNCXOPFUWUMCCFVTYIRLCJOPYCMBGLRTYPWUMCOXQSFVVSZRVSROKWTVHZUJONUTREBTTVNCJUDIUWCROWFUWVSGAHSVPFULMXDYWIOWCMRBKZVJDDIUWTVTXUMWVFEKMLBFTPVDWUMCKTBXBORHLSOAXKRORUWARZOSFWGIKNUXAUJZLSWXEKUX | |
HUIMXTXEOCXWCQVDKRSVJCSNYMUUZDFFCWLWWWKVVJIBAPIQTVUOFRFEIYSDWTZLEYIZICPOWSLRRUMVSOPDLVWRDFGKECSCBWWURXJRRKUGXUPOOOZMIPWKPKWVCKXXSYWFJKNUKMCTUDTUIRWMVWDBXBVIBHVIXAKMCGZSUBUWUMLUGWOJFJNRJATRZOCCTOHVHLORXYNSTLSTVOPUVXSWEMPWTPUOXOUFURFMAEIJUM |
This file contains 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 sys | |
if len(sys.argv) <= 1: | |
print 'usage: python pdb2fasta.py file.pdb > file.fasta' | |
exit() | |
input_file = open(sys.argv[1]) | |
letters = {'ALA':'A','ARG':'R','ASN':'N','ASP':'D','CYS':'C','GLU':'E','GLN':'Q','GLY':'G','HIS':'H', | |
'ILE':'I','LEU':'L','LYS':'K','MET':'M','PHE':'F','PRO':'P','SER':'S','THR':'T','TRP':'W', |
This file contains 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
[sig fs] = read_NIST_file(filename); % read the input file, assume filename is supplied | |
NFFT = 1024; | |
WINLEN = 0.025; %frame length in ms | |
WINSTEP = 0.01; | |
frames = frame_sig(sig, WINLEN*fs, WINSTEP*fs, @hamming); | |
cspec = fft(frames,NFFT,2); % complex spectrum | |
pspec = abs(cspec).^2; % power spectrum of noisy signal | |
phase = angle(cspec); | |
% do spectral subtraction, produce modified_pspec |
This file contains 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
SNR=40; % the SNR of white noise to apply to each file | |
path = '/home/james/databases/speech_db/timit_xxl_white/db/timit_full'; | |
[status,result]=system(['find ',path,' -name "*.wav" | grep -v snr > ',path,'/timit_list.txt']); | |
listfilename = [path,'/timit_list.txt']; | |
filelist = fopen(listfilename); | |
wavname = fgetl(filelist); | |
count = 1; | |
while ischar(wavname), |
This file contains 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 itertools import product | |
key = "EPSDUCVWYM ZLKXNBTFGORIJHAQ" | |
IND2L = dict(zip(list(product((1,2,3),repeat=3)),key)) | |
L2IND = dict(zip(key,list(product((1,2,3),repeat=3)))) | |
ptext = 'DEFEND THE EAST WALL OF THE CASTLE' | |
ctext = "" | |
for c in ptext: |
This file contains 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
function arburg(x,p) | |
N = length(x) | |
P = zeros(1,p+1) | |
f = zeros(p+1,N) | |
b = zeros(p+1,N) | |
a = zeros(p,p) | |
# Initialisation | |
f[1,:] = x |
NewerOlder