Giter VIP home page Giter VIP logo

gmat's Introduction

gmat

golang matrix library

Sample

package main

import (
	"github.com/kuroko1t/gmat"
	"fmt"
)


func main() {
    xdot := [][]float64{
        {2, 3, 6},
        {1, 4, 4},
        {2, 1, 5},
        {3, 4, 3},
    }
    ydot := [][]float64{
        {3, 1, 2, 2, 3},
        {2, 4, 2, 4, 6},
        {3, 4, 6, 3, 8},
    }
    xtensor := gmat.Make2DInitArray(xdot)
    ytensor := gmat.Make2DInitArray(ydot)
    ztensor := gmat.Dot(xtensor, ytensor)
    fmt.Println(ztensor.CPU)
}

Document

https://godoc.org/github.com/kuroko1t/gmat

API

  • Make(shape []int) Tensor
  • Make2DInitArray(x [][]float64) Tensor
  • MakeInit(n int, m int, value float64) Tensor
  • Add(x, y Tensor) Tensor
  • AddE(x Tensor, y float64) Tensor
  • Sub(x, y Tensor) Tensor
  • SubE(x Tensor, y float64) Tensor
  • MulE(x Tensor, y float64) Tensor
  • Mul(x, y Tensor) Tensor
  • Div(x, y Tensor) Tensor
  • T(x Tensor) Tensor
  • Apply(x Tensor, fn func(float64) float64) Tensor
  • Dot(x, y Tensor) Tensor
  • SumRow(x Tensor) Tensor
  • SumCol(x Tensor) Tensor
  • Cast(x Tensor, castSize int) Tensor
  • MaxCol(x Tensor) Tensor
  • ArgMaxCol(x Tensor) [][]int
  • RandomNorm2D(r int, c int, init float64) Tensor
  • HeNorm2D(r int, c int) Tensor
  • Conv1D(x, filter Tensor, stride int) Tensor

License

gmat is licensed under the Apache License, Version2.0

gmat's People

Contributors

kuroko1t avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.