Commit 366d2938 authored by alessio.quaresima's avatar alessio.quaresima
Browse files

use example

parent 5807fb4b
include("SpikeTimit.jl")
include("src/SpikeTimit.jl")
path = "/home/cocconat/Documents/Research/phd_project/speech/litwin-kumar_model_thesis/Spike TIMIT"
#Create the path strings leading to folders in the data set
test_path = joinpath(path, "test");
train_path = joinpath(path, "train");
......@@ -8,14 +9,43 @@ dict_path = joinpath(path, "DOC/TIMITDIC.TXT");
train = SpikeTimit.create_dataset(;dir= train_path)
test = SpikeTimit.create_dataset(;dir= test_path)
dict = SpikeTimit.create_dictionary(file=dict_path)
##
# Parameters to compute the input_data
target_dialects = 1
target_dialects = [1]
target_gender = 'f'
samples_per_word = 10
samples = 10
n_speakers = 1
repetitions = 75 # amount of times you present the network with each unique stimulus.
silence_time = 0.15 # in seconds
n_features = 10 # number of features combined from input frequencies
##
speakers = []
for word in words
speaker = @linq train |>
where(:dialect . target_dialects, :gender.==target_gender, word . :words) |>
select(:speaker) |> unique
push!(speakers,Set(speaker.speaker))
end
speakers = collect(intersect(speakers...))
single_speaker_train = filter(:speaker=> x->x speakers, train)
## Select the inputs
durations, spikes, labels = SpikeTimit.select_inputs(df=single_speaker_train, words=words, samples = samples, n_feat = n_features);
## Mix them, if you like you can mix differently. Look at the function, it's simple!
all_ft, all_n, words_t, phones_t = SpikeTimit.mix_inputs(;durations=durations, spikes=spikes, labels=labels, repetitions=repetitions, silence_time)
SpikeTimit.convert_to_dt(words_t, 0.1)
SpikeTimit.convert_to_dt(phones_t, 0.1)
words_savepoints = SpikeTimit.get_savepoints(trans= words_t, n_measure=10)
ph_savepoints, ll = SpikeTimit.get_savepoints(trans= phones_t, n_measure=10)
## Comparing the last firing time, the duration of all words and the
## intervals of the words and phonemes we expect that it's well done!
all_ft[end]
repetitions*(sum(durations)+(silence_time*(length(durations))))-silence_time
words_t.intervals[end]
phones_t.intervals[end]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment