Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tartarus/deep

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tartarus/deep

Deep learning framework for TypeScript

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Tartarus Deep Learning Framework

Deep learning framework for TypeScript. Run it on a browser, on AWS Lambda, or on anything that runs Node.js!

Travis CI Coverage Status Codacy Maintainability David David

Features

From-the-ground-up implementation for:

  • Math: Vector and Matrix operations, seeded randomization
  • Graph: Acyclic networks, automated data routing, support for multiple input and output layers
  • Machine Learning: Forward and back propagation, logistic regression, gradient descent, loss (cost) functions, activation functions, optimizers, metrics, dense layers, concat layers

Goals

  • From-the-ground-up implementation for all standard deep learning operations
  • Compatibility with Node.js, modern browsers, and AWS Lambda

Example

import { Model, Dense, MemoryInputFeed } from '@tartarus/deep';

/*
 * 1. Define a model 
 *    - 4 input nodes
 *    - hidden layer with 5 nodes and sigmoid activation
 *    - output layer with 3 nodes and softmax activation 
 */
const model = new Model({ optimizer: 'stochastic', loss: 'mean-squared-error' });

model
  .input(4)
  .push(new Dense({ units: 5, activation: 'sigmoid' }))
  .push(new Dense({ units: 3, activation: 'softmax' }));

model.compile()
  .then(
    async () => {
      /* 2. Prepare three samples of training data */
      const feed = new MemoryInputFeed();
      
      feed
        .add([1, 2, 3, 4], [1, 0, 0]) // .add(input, expected output)
        .add([4, 3, 2, 1], [0, 1, 0])
        .add([5, 6, 7, 8], [0, 0, 1]);
      
      
      /* 3. Train model */
      await model.fit(feed, { batchSize: 1, epochs: 100 });
      
      
      /* 4. Predict */
      const result = await model.predict([8, 9, 10, 11]);
      
      console.log(`Prediction: ${result.getDefaultValue().toJSON()}`);
    }
  );

Model

Layers

Dense Layer

Concat Layer

Supplementary

Activation Functions

Loss Functions

Initializers

Metrics

Input

Keywords

FAQs

Package last updated on 09 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc