MentDB
Mentalese Database Engine
Back / All functions / Deep Learning

Deep learning.

dl n_bayesian showdl n_bayesian existdl n_bayesian create_modeldl n_bayesian loaddl n_bayesian predictdl n_bayesian deletedl bayesian showdl bayesian existdl bayesian createdl bayesian add_sentencedl bayesian initdl bayesian predictdl bayesian deletedl csv execute_configdl csv load_networkdl csv predictdl img step1 create_trainingdl img step2 add_imagedl img step3 create_hidden_layerdl img step4 create_or_load_networkdl img step5 train_networkdl img step6 predictdl img step7 close_filedl img execute_configdl img load_networkdl img predict

dl n_bayesian show

Description

    To show all Naive Bayesian networks.

admin
dl n_bayesian show
mentdb
[]

dl n_bayesian exist <key>

Description

    To check if a Naive Bayesian network already exist.

Parameters

    key:   The network key - string - required
admin
dl n_bayesian exist "bayesian1";
mentdb
1

dl n_bayesian create_model <lang> <train_file_path> <iterations_param> <model_file_path_to_save>

Description

    To create a new Naive Bayesian network model.

Parameters

    lang:   The language - string - required
    train_file_path:   The train file path - string - required
    iterations_param:   The iterations param - number (ex: 10) - required
    model_file_path_to_save:   The model file path to save - string - required
admin
dl n_bayesian create_model "en" "path/train.txt" 10 "path/model.bin";
mentdb
1

dl n_bayesian load <key> <model_file_path>

Description

    To load a Naive Bayesian network model.

Parameters

    key:   The network key - string - required
    model_file_path:   The model file path - string - required
admin
dl n_bayesian load "bayesian1" "path/model.bin";
mentdb
1

dl n_bayesian predict <key> <sentence>

Description

    To predict a sentence.

Parameters

    key:   The network key - string - required
    sentence:   The sentence - string - required
admin
dl n_bayesian predict "bayesian1" "I'm happy";
mentdb
{ "input": "I\u0027m happy", "prediction": "positif", "best_percent": "66,666667 %", "best_index": 0, "probabilities": [ { "prob_double": 0.6666666666666666, "index": 0, "prob_percent": "66,666667 %", "key": "positif" }, { "prob_double": 0.3333333333333333, "index": 1, "prob_percent": "33,333333 %", "key": "negatif" } ], "best_double": 0.6666666666666666 }

dl n_bayesian delete <key>

Description

    To delete a Naive Bayesian network.

Parameters

    key:   The network key - string - required
admin
dl n_bayesian delete "bayesian1";
mentdb
1

dl bayesian show

Description

    To show all Bayesian networks.

admin
dl bayesian show
mentdb
[]

dl bayesian exist <key>

Description

    To check if a Bayesian network already exist.

Parameters

    key:   The network key - string - required
admin
dl bayesian exist "bayesian1";
mentdb
1

dl bayesian create <key> <cats>

Description

    To create a new Bayesian network.

Parameters

    key:   The network key - string - required
    cats:   The categories (JSON array) - string - required
admin
dl bayesian create "bayesian1" "[\"positif\", \"negatif\"]";
mentdb
1

dl bayesian add_sentence <key> <cat> <sentence>

Description

    To create a new Bayesian network.

Parameters

    key:   The network key - string - required
    cat:   The category key - string - required
    sentence:   The sentence - string - required
admin
dl bayesian add_sentence "bayesian1" "positif" "I'm happy";
mentdb
1

dl bayesian init <key> <laplace_int>

Description

    To init a Bayesian network.

Parameters

    key:   The network key - string - required
    laplace_int:   The Laplace int - number - required
admin
dl bayesian init "bayesian1" 1;
mentdb
1

dl bayesian predict <key> <sentence>

Description

    To predict a sentence.

Parameters

    key:   The network key - string - required
    sentence:   The sentence - string - required
admin
dl bayesian predict "bayesian1" "I'm happy";
mentdb
{ "input": "I\u0027m happy", "prediction": "positif", "best_percent": "66,666667 %", "best_index": 0, "probabilities": [ { "prob_double": 0.6666666666666666, "index": 0, "prob_percent": "66,666667 %", "key": "positif" }, { "prob_double": 0.3333333333333333, "index": 1, "prob_percent": "33,333333 %", "key": "negatif" } ], "best_double": 0.6666666666666666 }

dl bayesian delete <key>

Description

    To delete a Bayesian network.

Parameters

    key:   The network key - string - required
admin
dl bayesian delete "bayesian1";
mentdb
1

dl csv execute_config <jsonConfig>

Description

    Train a CSV file.

Parameters

    jsonConfig:   The train JSON configuration - string - required
admin
json load "csv_config" "{}"; json iobject "csv_config" / "filePath" "demo/iris.data.txt" STR; json iobject "csv_config" / "modelPath" "demo/iris.md" STR; json iobject "csv_config" / "helperPath" "demo/iris.hl" STR; json iobject "csv_config" / "nbLoop" "6" STR; json iobject "csv_config" / "validationPercent" "0.3" STR; json iobject "csv_config" / "shuffle" "true" STR; json iobject "csv_config" / "seed" "1001" STR; json iobject "csv_config" / "cols" "[]" ARRAY; json load "col" "{}"; json iobject "col" / "index" "0" STR; json iobject "col" / "title" "sepal-length" STR; json iobject "col" / "type" "in" STR; json iarray "csv_config" "/cols" (json doc "col") OBJ; json load "col" "{}"; json iobject "col" / "index" "1" STR; json iobject "col" / "title" "sepal-width" STR; json iobject "col" / "type" "in" STR; json iarray "csv_config" "/cols" (json doc "col") OBJ; json load "col" "{}"; json iobject "col" / "index" "2" STR; json iobject "col" / "title" "petal-length" STR; json iobject "col" / "type" "in" STR; json iarray "csv_config" "/cols" (json doc "col") OBJ; json load "col" "{}"; json iobject "col" / "index" "3" STR; json iobject "col" / "title" "petal-width" STR; json iobject "col" / "type" "in" STR; json iarray "csv_config" "/cols" (json doc "col") OBJ; json load "col" "{}"; json iobject "col" / "index" "4" STR; json iobject "col" / "title" "species" STR; json iobject "col" / "type" "out" STR; json iarray "csv_config" "/cols" (json doc "col") OBJ; dl csv execute_config (json doc "csv_config");
mentdb
1

dl csv load_network <modelFilePath> <helperFilePath>

Description

    Load the model and the helper into the memory.

Parameters

    modelFilePath:   The model file path - string - required
    helperFilePath:   The helper file path - string - required
admin
dl csv load_network "demo/iris.md" "demo/iris.hl";
mentdb
1

dl csv predict <jsonArrayInput>

Description

    Predict from the model.

Parameters

    jsonArrayInput:   The JSON array that contains input values - string - required
admin
json load "input" "[5.9, 3.0, 5.1, 1.8]"; dl csv predict (json doc "input");
mentdb
Iris-virginica
admin
json load "input" "[5.6, 2.9, 3.6, 1.3]"; dl csv predict (json doc "input");
mentdb
Iris-versicolor

dl img step1 create_training <writerId> <width> <height> <isRGB>

Description

    Create a training file.

Parameters

    writerId:   The writer id - string - required
    width:   The image width - number - required
    height:   The image height - number - required
    isRGB:   Is RGB ? (true, false) - bool - required
admin
#Create the training file; file writer_open "w1" "demo/animals/imgTrainConfig.txt" true TEXT "utf-8"; dl img step1 create_training "w1" 100 100 true;
mentdb
1

dl img step2 add_image <writerId> <imgPath> <identity>

Description

    Add image into the training file.

Parameters

    writerId:   The writer id - string - required
    imgPath:   The image path - string - required
    identity:   The image tag - string - required
admin
#Load input images; -> "[dir]" "demo/animals/english_springer"; -> "[id]" "english_springer"; json load "files" (file dir_list [dir]); -> "[nbFiles]" (json count "files" /); -> "[iFiles]" 0; for (-> "[i]" 0) (< [i] [nbFiles]) (++ "[i]") { -> "[cur_file]" (json select "files" (concat "/[" [i] "]")); if (string ends_with [cur_file] ".jpg") { dl img step2 add_image "w1" (concat [dir] "/" [cur_file]) [id]; ++ "[iFiles]"; }; }; file writer_flush "w1"; concat [iFiles] " files added."
mentdb
1

dl img step3 create_hidden_layer <writerId> <nbNeuron>

Description

    Create a hidden layer.

Parameters

    writerId:   The writer id - string - required
    nbNeuron:   The number of neuron in the hidden layers - number - required
admin
dl img step3 create_hidden_layer "w1" "100" file writer_flush "w1";
mentdb
1

dl img step4 create_or_load_network <writerId> <activation> <saveNetworkPath>

Description

    Create or load a network.

Parameters

    writerId:   The writer id - string - required
    activation:   The activation function (ex: BiPolar|BipolarSteepenedSigmoid|ClippedLinear|Competitive|Elliott|ElliottSymmetric|Gaussian|Linear|LOG|Ramp|ReLU|Sigmoid|SIN|SoftMax|SteepenedSigmoid|Step|TANH) - string - required
    saveNetworkPath:   The path to save the network - string - required
admin
dl img step4 create_or_load_network "w1" "tanh" "demo/animals/network.eg"; file writer_flush "w1";
mentdb
1

dl img step5 train_network <writerId> <mode> <minutes> <strategyError> <strategyCycles> <saveNetworkPath>

Description

    Train a network.

Parameters

    writerId:   The writer id - string - required
    mode:   The mode (console|gui) - string - required
    minutes:   The number of minutes - number - required
    strategyError:   The strategy error (ex: 0.25) - number - required
    strategyCycles:   The strategy cycles (ex: 50) - number - required
    saveNetworkPath:   The path to save the network - string - required
admin
dl img step5 train_network "w1" "console" 1 0.25 50 "demo/animals/network.eg"; file writer_flush "w1";
mentdb
1

dl img step6 predict <writerId> <imgPath> <identity>

Description

    Predict an image from a neural network.

Parameters

    writerId:   The writer id - string - required
    imgPath:   The image path - string - required
    identity:   The image tag - string - required
admin
#Load input images; -> "[dir]" "demo/animals/english_springer_predict"; -> "[id]" "english_springer"; json load "files" (file dir_list [dir]); -> "[nbFiles]" (json count "files" /); -> "[iFiles]" 0; for (-> "[i]" 0) (< [i] [nbFiles]) (++ "[i]") { -> "[cur_file]" (json select "files" (concat "/[" [i] "]")); if (string ends_with [cur_file] ".jpg") { dl img step6 predict "w1" (concat [dir] "/" [cur_file]) [id]; ++ "[iFiles]"; }; }; file writer_flush "w1"; concat [iFiles] " files added.";
mentdb
1

dl img step7 close_file <writerId>

Description

    Close the config file.

Parameters

    writerId:   The writer id - string - required
admin
#Close the config file; file writer_close "w1";
mentdb
1

dl img execute_config <trainConfigFilePath>

Description

    Execute a config training file

Parameters

    trainConfigFilePath:   The train config file path - string - required
admin
in editor { dl img execute_config "demo/animals/imgTrainConfig.txt" };
mentdb
1

dl img load_network <networkPath>

Description

    Load a network into the memory

Parameters

    networkPath:   The network path - string - required
admin
dl img load_network "demo/animals/network.eg";
mentdb
1

dl img predict <imagePath> <isRGB> <width> <height> <jsonIdentity>

Description

    Predict an image from the network

Parameters

    imagePath:   The image path - string - required
    isRGB:   Is RGB ? (true|false) - string - required
    width:   The image width - string - required
    height:   The image height - string - required
    jsonIdentity:   The json identity - string - required
admin
dl img predict "dir/image.jpg" true 100 100 "{ \"0\": \"english_springer\" }";
mentdb
1




© 2012 - 2019 - MentDB.