Package Exports
- nrn-ml
Readme
Getting Started
This package is used for low-level control of the machine learning models that is used in nrn-agents.
Installation
To start using the package, you can install it as follows:
npm install nrn-mlModel Initialization
Initializing a neural network with 1 action head
const { NeuralNetworkMultihead } = require("nrn-ml")
const modelData = {
config: {
inputDim: 5,
neurons: [12, 6],
actionOrder: ["action 1", "action 2"],
modelType: "neural-network"
}
}
const model = new NeuralNetworkMultihead(modelData)Initializing a tabular model with 2 action heads
const { TabularModel } = require("nrn-ml")
const modelData2 = {
config: {
inputDim: 10,
actionNames: ["Direction", "Combat"],
actionOrder: [["up", "down"], ["attack", "defend"]],
actionPolicies: ["argmaxPolicy", "probabilisticSampling"],
modelType: "simple"
}
}
const model = new TabularModel({ metadata }, true)