Skip to content
Snippets Groups Projects
acsf.cpp 3.07 KiB
Newer Older
  • Learn to ignore specific revisions
  • //
    // Created by martin on 13.08.19.
    //
    
    #include <4neuro.h>
    
    int main() {
        /* Representation of N2He+ molecule using Atomic-centered Symmetry Functions (Behler's approach) */
    
    
    //    // Cutoff functions
    //    l4n::CutoffFunction1 cutoff1(1.1);
    //    l4n::CutoffFunction2 cutoff2(1.5);
    //    l4n::CutoffFunction2 cutoff3(1.2);
    //
    //    l4n::CutoffFunction2 cutoff4(1.3);
    //    l4n::CutoffFunction2 cutoff5(1.9);
    //    l4n::CutoffFunction2 cutoff6(2.9);
    //
    //    // Symmetry functions
    //    l4n::G1 sym_f1(&cutoff1);
    //    l4n::G2 sym_f2(&cutoff2, 0.15, 0.75);
    //    l4n::G2 sym_f3(&cutoff3, 0.1, 0.2);
    //
    //    l4n::G3 sym_f4(&cutoff4, 0.3);
    //    l4n::G4 sym_f5(&cutoff5, 0.05, true, 0.05);
    //    l4n::G4 sym_f6(&cutoff5, 0.05, false, 0.05);
    //    l4n::G5 sym_f7(&cutoff6, 0.05, true, 0.05);
    //    l4n::G5 sym_f8(&cutoff6, 0.05, false, 0.05);
    //
    //    std::vector<l4n::SymmetryFunction*> nitrogen_sym_funcs = {&sym_f1, &sym_f2, &sym_f7, &sym_f8};
    //    std::vector<l4n::SymmetryFunction*> helium_sym_funcs = {&sym_f2, &sym_f3, &sym_f4, &sym_f5, &sym_f6};
    //
    //    // Definition of sub-nets
    //    std::vector<unsigned int> nitrogen_hidden_neurons = {10};
    //    std::vector<l4n::NEURON_TYPE> nitrogen_neuron_types = {l4n::NEURON_TYPE::LOGISTIC};
    //    std::vector<unsigned int> helium_hidden_neurons = {10};
    //    std::vector<l4n::NEURON_TYPE> helium_neuron_types = {l4n::NEURON_TYPE::LOGISTIC};
    //
    //    // Definition of elements
    //    l4n::Element nitrogen = l4n::Element("N",
    //                                         2,
    //                                         nitrogen_sym_funcs,
    //                                         nitrogen_hidden_neurons,
    //                                         nitrogen_neuron_types,
    //                                         false);
    //
    //    l4n::Element helium = l4n::Element("He",
    //                                       1,
    //                                       helium_sym_funcs,
    //                                       nitrogen_hidden_neurons,
    //                                       nitrogen_neuron_types,
    //                                       false);
    //
    //    std::unordered_map<l4n::ELEMENT_SYMBOL, l4n::Element*> elements;
    //    elements[l4n::ELEMENT_SYMBOL::N] = &nitrogen;
    //    elements[l4n::ELEMENT_SYMBOL::He] = &helium;
    //
    //    // Definition of particles' Cartesian coordinates
    //    std::vector<double> n1 = {0,0};
    //    std::vector<double> n2 = {1,0};
    //    std::vector<double> he = {0,1};
    //    std::vector<std::pair<l4n::ELEMENT_SYMBOL, std::vector<double>>> particles;
    //    particles.emplace_back(std::make_pair(l4n::ELEMENT_SYMBOL::N, n1));
    //    particles.emplace_back(std::make_pair(l4n::ELEMENT_SYMBOL::N, n2));
    //    particles.emplace_back(std::make_pair(l4n::ELEMENT_SYMBOL::He, he));
    //
    //    // Neural network construction
    //    l4n::NeuralNetwork nn = l4n::NeuralNetwork(elements, particles);
    //
    //    std::cout << nn.get_n_neurons() << std::endl;
    //    std::cout << nn.get_n_inputs() << std::endl;
    //    std::cout << nn.get_n_outputs() << std::endl;
    //    std::cout << nn.get_n_biases() << std::endl;
    //
    //    // Neural network training
    //    // TODO