JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q33217F
  • License ISC

Core ML library for the NRN ecosystem

Package Exports

  • nrn-ml

Readme



install size Twitter LinkedIn

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-ml

Model 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)