clear all
close all


%max(vowel.create_input_vector(13,19))
%for i=1:lang2_sound.n_cons
%    lang2_sound.create_consonant_input_vector(i)
%end
lang2_meaning.create_custom_input_vector(1, 1)
% lang2_meaning.SOVA.create_input_vector
% % rng(0); %so we control the generating of the training data
% rng('shuffle'); %so the training data is as random as possible
% 
% % config
% config.getInstance.path_initial_images
% config.getInstance.path_images
% config.getInstance.path_dbms
% config.getInstance.path_measures
% 
% % general language / sounds / meanings / functionality
% lang1_sound.NONE;
% A_f2_erb = lang1_sound.f2_erbs(lang1_sound.A.v_index);
% lang1_sound_n_auditory_nodes = lang1_sound.n_auditory_nodes;
% [sample_f1, sample_f2] = vowel.sample(lang1_sound.O.f1_erb, lang1_sound.O.f2_erb);
% index_of_b_is = lang2_sound.BARY.c1_index;
% assert(index_of_b_is, 1, "mess with consonant indexes")
% vowel_index1 = find(strcmp(lang2_sound.vowels, "ɐ"), 1, "first");
% vowel_index2 = lang2_sound.SOVA.v1_index;
% assert(vowel_index1 == vowel_index2, "mess with vowel indexes")
% [f1, f2] = vowel.sample_with_std( ...
%     lang2_sound.f1_erbs(vowel_index1), lang2_sound.f2_erbs(vowel_index1), ...
%     lang2_sound.f1_std(vowel_index1), lang2_sound.f2_std(vowel_index1));
% assert(lang2_sound.ROZA.f2_erbs(lang2_sound.SOVA.v2_index) == ...
%     lang2_sound.ZHABA.f2_erbs(lang2_sound.SOVA.v2_index), ...
%     "2nd vowels of [roza] and [zhaba] are the same")
% lang2_sound.draw_input(lang2_sound.ZHAR.sample_and_create_input_vector)
% lang2.n_utterances;
% lang1.n_input_nodes;
% assert(lang1_sound.get_sound_by_index(5) == lang1_sound.U)
% assert(lang1.get_meaning_of_sound(1) == 5)
% assert(lang1.get_meaning_of_sound(6) == 6)
% assert(lang1.get_sound_of_meaning(5) == 1)
% assert(lang1.get_sound_of_meaning(6) == 6)
% assert(lang2_sound.ZHABA.all_sounds_index == 14)
% assert(lang2_meaning.ZHABA.all_meanings_index == 14)
% 
% % drawing functionality
% lang1_sound.draw_input(lang1_sound.A.create_input_vector)
% lang2_sound.draw_input(lang2_sound.ZHAR.create_input_vector)
% lang2_sound.draw_input(lang2_sound.ZHAR.sample_and_create_input_vector)
% lang2_sound.draw_input(lang2_sound.NONE.create_input_vector)
% draw.vowel(vowel.create_input_vector(0, 0), draw.lang1_vowel_input)
% draw.consonant(lang2_sound.create_consonant_input_vector(lang2_sound.n_cons+1), draw.lang2_consonant1_input)
% draw.meaning(lang1_meaning.NONE.create_input_vector, draw.lang1_meaning_input)
% lang2_meaning.draw_input(lang2_meaning.SOVA.create_input_vector)
% lang1_meaning.draw_input(lang1_meaning.GRAIN.create_input_vector)
% lang2_meaning.draw_output(lang2_meaning.create_custom_input_vector(lang2_meaning.n_lex+1, lang2_meaning.n_lex+1))
% lang1_meaning.draw_output(lang1_meaning.create_custom_input_vector(lang1_meaning.n_lex+1, lang1_meaning.n_lex+1))
% 
% 
% 
% % LANGUAGE 1
% dataset1 = data_set(lang1, 20);
% comment('Generating data for language1', 'header');
% data = dataset1.generate_observations;
% comment('Training a Deep Boltzmann Machine on language1', 'header');
% dbm1 = dbm(lang1);
% dbm1.learn(data);
% comment('Use - Produce', 'else');
% dbm1.produce([zeros(1, lang1_sound.n_auditory_nodes) lang1_meaning.EGG.create_input_vector]);
% comment('Use - Comprehend', 'else');
% dbm1.comprehend([lang1_sound.A.create_input_vector zeros(1, lang1_meaning.n_semantic_nodes)]);
% lang1.draw_output(dbm1.activities{1})
% dbm1.draw
% 
% 
% % LANGUAGE 2
% dataset2 = data_set(lang2, 20);
% comment('Generating data for language2', 'header');
% data = dataset2.generate_observations;
% comment('Training a Deep Boltzmann Machine on language2', 'header');
% dbm2 = dbm(lang2);
% dbm2.learn(data);
% comment('Use - Produce', 'else');
% dbm2.produce([zeros(1, lang2_sound.n_auditory_nodes) lang2_meaning.SOVA.create_input_vector]);
% comment('Use - Comprehend', 'else');
% dbm2.comprehend([lang2_sound.SOVA.create_input_vector zeros(1, lang2_meaning.n_semantic_nodes)]);
% lang2.draw_output(dbm2.activities{1})
% 
% 
% 
% % 
% % comment("Training the Salakhutdinov's DBM", "header");
% % addpath('./salakhutdinov_dbm')
% % sal_demo
