Skip to content

Commit

Permalink
Added randomization of neural networks after each token
Browse files Browse the repository at this point in the history
  • Loading branch information
FuexFollets committed Feb 8, 2024
1 parent 36a261b commit 61e6f60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/text_prediction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ int main(int argc, char** argv) {
// ------------------------- Predict -------------------------

for (const lc::grammar::Token& token: tokens) {
completer.set_word_vector_improviser_nn(
{improviser_input_size, 200, 200, improviser_output_size}, true);

completer.set_ephemeral_memory_accmulator_nn(
{predictor_input_size, 200, 200, predictor_output_size}, true);

std::cout << "\nToken: " << token << "\n";

lc::TextCompleter::EphemeralMemoryNNOutput output {completer.predict_next_token_value(
Expand All @@ -83,6 +89,8 @@ int main(int argc, char** argv) {

std::cout << "Ephemeral memory: " << lc::fancy_eigen_vector_str(output.ephemeral_memory)
<< "\n";
std::cout << "Predicted word vector value: "
<< lc::fancy_eigen_vector_str(output.word_vector_value) << "\n";

const std::vector<lc::VectorDatabase::SearchResult> results =
completer.vector_database.search_closest_vector_value_n(output.word_vector_value, 10);
Expand Down

0 comments on commit 61e6f60

Please sign in to comment.