// train.js BAYES STAR (c) coppola.ai const mongoose = require("mongoose") const { CreateStorage, ConnectDB } = require("./storage") const { ComputeBacklinks } = require("./choose") const { InitializeWeights, TrainOnExample, DumpWeights } = require("./maxent") async function main() { await ConnectDB() const storage = await CreateStorage("testdb1") const implications = await storage.GetAllImplications() for (const implication of implications) { await InitializeWeights(implication) } const propositions = await storage.GetAllPropositions() for (const proposition of propositions) { const backlinks = await ComputeBacklinks(storage, proposition) await TrainOnExample(proposition, backlinks) } await DumpWeights() await mongoose.disconnect(); } main()