Proxem.NumNet 1.5.1

C# scientific package containing among other things :
           * an N-dimensionnal array object and the main functions to operate on it
           * the main linear algebra functions on n-dimensionnal arrays.
       The synthax is mainly based on python's numpy library. MKL is used for optimized performances.

There is a newer version of this package available.
See the version list below for details.
Install-Package Proxem.NumNet -Version 1.5.1
dotnet add package Proxem.NumNet --version 1.5.1
<PackageReference Include="Proxem.NumNet" Version="1.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Proxem.NumNet --version 1.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NumNet

NumNet is an optimized library for matrix operations and scientific programming written in C# and developped at Proxem.
NumNet is inspired by python's numpy library to facilitate its use by python developpers.

Table of contents

Requirements

NumNet was developped in .Net Standard 2.0 and is compatible with both .Net Framwork and .Net Core thus working on Windows and Linux platform.
For Mac OS users there shouldn't be any problem but we didn't test extensively.

NumNet relies on BlasNet for the low level operations on arrays.
See BlasNet documentation for further informations on how to use Intel's MKL for low level operations.

Examples

Matrix creations

To create an empty 2-dimensional array of dimension 3 and 4 you can use

var zeroArray = NN.Zeros(3, 4);

The follwing creates a 1-dimensional array with all even number from 0 to 40

var range = NN.Range(0, 40, step: 2);

To reshape the previous array to a 2-d dimension array use var 2dRange = range.Reshape(4, 5);.
This operation will be a O(1) if possible but it might need to copy the values
(if the initial matrix is transposed or more generaly if the data in the initial array are not contiguous.)

Random initializations are also supported, here are a few examples of the supported distributions

var bern = NN.Random.Bernouilli(0.5, 2, 3);  // 2 x 3 matrix
var norm = NN.Random.Normal(0, 1, 10, 10);   // 10 x 10 normally distributed matrix
var unif = NN.Random.Uniform(-1, 1, 5, 6);   // 5 x 6 uniform matrix between -1 and 1

Accessing values

Let's start with a 2-d array of size (5 x 6)

var M = NN.Range(30).Reshape(5, 6);

To access a single value in the array we will use M[i, j].
NumNet also supports more complex slicing functions.
To select the first column of the array we will use

var vector = M[Slicer._, 0]; // 'Slicer._' correspond to ':' in numpy

More control on the slices is made using the following

var v0 = M[0]; // [0, 1, 2, 3, 4, 5]
var v1 = M[Slicer.Range(0, 3), Slicer.Until(2)]; // [[0, 1],[6, 7],[12, 13]]
var v2 = M[1, Slicer.From(1)]; // [7, 8, 9, 10, 11]
var v3 = M[Slicer.Range(3, -1), -2]; // [16, 22]

Base operations

The synthax for operations between multi-dimensional arrays is mostly the same as numpy (with Pascal Case).
For instance, matrix multiplications will be done with the follwing code

var M = NN.Random.Normal(0, 1, 3, 4);
var N = NN.Random.Bernouilli(0.6, 4, 5);

var MN = NN.Dot(M, N) // gives a (3 x 5) matrix
var MMNTranspose = NN.Dot(MN.T, M) // gives a (5 x 4) matrix

where MN.T stands for the transpose of MN.

Github

The code of NumNet is open-source, you can find it on github here

Contact

If you can't make NumNet work on your computer or if you have any tracks of improvement drop us an e-mail at one of the following address:

  • thp@proxem.com
  • joc@proxem.com

License

NumNet is Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.

NumNet

NumNet is an optimized library for matrix operations and scientific programming written in C# and developped at Proxem.
NumNet is inspired by python's numpy library to facilitate its use by python developpers.

Table of contents

Requirements

NumNet was developped in .Net Standard 2.0 and is compatible with both .Net Framwork and .Net Core thus working on Windows and Linux platform.
For Mac OS users there shouldn't be any problem but we didn't test extensively.

NumNet relies on BlasNet for the low level operations on arrays.
See BlasNet documentation for further informations on how to use Intel's MKL for low level operations.

Examples

Matrix creations

To create an empty 2-dimensional array of dimension 3 and 4 you can use

var zeroArray = NN.Zeros(3, 4);

The follwing creates a 1-dimensional array with all even number from 0 to 40

var range = NN.Range(0, 40, step: 2);

To reshape the previous array to a 2-d dimension array use var 2dRange = range.Reshape(4, 5);.
This operation will be a O(1) if possible but it might need to copy the values
(if the initial matrix is transposed or more generaly if the data in the initial array are not contiguous.)

Random initializations are also supported, here are a few examples of the supported distributions

var bern = NN.Random.Bernouilli(0.5, 2, 3);  // 2 x 3 matrix
var norm = NN.Random.Normal(0, 1, 10, 10);   // 10 x 10 normally distributed matrix
var unif = NN.Random.Uniform(-1, 1, 5, 6);   // 5 x 6 uniform matrix between -1 and 1

Accessing values

Let's start with a 2-d array of size (5 x 6)

var M = NN.Range(30).Reshape(5, 6);

To access a single value in the array we will use M[i, j].
NumNet also supports more complex slicing functions.
To select the first column of the array we will use

var vector = M[Slicer._, 0]; // 'Slicer._' correspond to ':' in numpy

More control on the slices is made using the following

var v0 = M[0]; // [0, 1, 2, 3, 4, 5]
var v1 = M[Slicer.Range(0, 3), Slicer.Until(2)]; // [[0, 1],[6, 7],[12, 13]]
var v2 = M[1, Slicer.From(1)]; // [7, 8, 9, 10, 11]
var v3 = M[Slicer.Range(3, -1), -2]; // [16, 22]

Base operations

The synthax for operations between multi-dimensional arrays is mostly the same as numpy (with Pascal Case).
For instance, matrix multiplications will be done with the follwing code

var M = NN.Random.Normal(0, 1, 3, 4);
var N = NN.Random.Bernouilli(0.6, 4, 5);

var MN = NN.Dot(M, N) // gives a (3 x 5) matrix
var MMNTranspose = NN.Dot(MN.T, M) // gives a (5 x 4) matrix

where MN.T stands for the transpose of MN.

Github

The code of NumNet is open-source, you can find it on github here

Contact

If you can't make NumNet work on your computer or if you have any tracks of improvement drop us an e-mail at one of the following address:

  • thp@proxem.com
  • joc@proxem.com

License

NumNet is Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Proxem.NumNet:

Package Downloads
Proxem.Word2Vec
Package containing a word2vec object for fast nearest neighbors search. Saving and loading format are compatible with python's gensim module.
Proxem.TheaNet
Library for optimized Deep Learning models. The library is based on python's theano library and offers great tools to create deep learning models. Automatic gradient differentiation is available.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.6.0 569 2/11/2019
1.5.2 289 12/5/2018
1.5.1 240 12/4/2018
1.5.0 216 12/4/2018