Comments (3)
It's a pity. I prefer reusing existing libraries, however since this one is no longer maintained I started already doing some small changes. Thank you
https://github.com/Darelbi/NeuraSharp/tree/tensor/NeuraSharp/NeuraSharp.GenericTensor
Here it is. Right now I'm refactoring to use INumer interface, when finished I will try to look at SIMD-izing and use the fast matrix multiplication for the last 2 dimensions. I think the design is already pretty good so no need major changes.
from generictensor.
Hi, I want to add some opinion, I'm writing Machine Learning Stuff, and soon found myself to write stuff that is not available in c#. This library is very close to what I need (and only 1 another library do that). It would save me to write that. (was halfway through)
In machine learning you can have 1D or 2D input, tough sometimes 3D is used for multiple channels of colors in images so is a thin 3D. Sometimes real 3D input is possible. And since it is more convenient to train the neural network in batches of inputs you add 1 extra dimension to all the inputs. (Basicaly pack the inputs togheter, makes the pack one dimension higher than the elements of the pack)
In a neural network there is a operation that is feed forward input which basically is
given a NDimensional series of inputs x1,x2,x3,x4 and a bias b.
and a Weight matrix/tensor (N+1 dimensional) W
the output of the layer of neural network is defined as a(W*(x1|x2|x3|x4) + (b|b|b|b)) = (y1|y2|y3|y4) .. where a is a non-linearity function like sigmoid or tanh applied element-wise to all the results.
basically the Tensor multiplication is the most common used operation and it should be heavily optimized (Parallel.For + SIMD types + dividing the loops in small cache local batches + transpose before multyplying to allow exploit SIMD Vectors better convertin a ROW by COLUMNS product to a COLUMNs by COLUMNS product). If you provide a very good tensor multiplication the library is automatically the best choice for machine learning stuff around there.
Regarding the "Number providers" if you are willing to drop support for old .NET stuff there is already the INumber interface which provides all the stuff the Number providers does in example
public static void MySum<T>(T a, T b) where T:INumber<T>
{
return a+b+T.One;
}
Hoping forward to see of the project, if you are willing to implement the Tensor Sum/Multiplication before all other features and release a Prerelease with just that I'll be one of your first users for sure. Also it would be nice the library support extension capability
public interface MyMultiplyBy2Operation<T> : IUnaryOperation<T> where T:INumber
{
public T Compute(T Input); // called on residual elements on a SIMD vector
public Vector<T> Compute(Vector<T> input) // called on core elements to allow SIMD-ization
}
that would allow automatically to implement neural networks activation functions.
Regarding the types I would like just a Tensor type with size and dimensional check when you multiply or add 2 toghether.
from generictensor.
@Darelbi I'm glad you find the idea good. However sadly I don't have time or mood for working on this project anymore. It's an MIT-licensed project, so you're free to continue the work on your own
from generictensor.
Related Issues (18)
- Possible improvements
- GenericTensorException
- Reduced Row Echelon Form
- Interpreted Linq.Expression or loops/NativeAOT mode
- Wrong inverse
- No exceptions?
- New inverse algorithm?
- Error for single-element matrix inverse
- Inverting a matrix twice causes the program to get stuck HOT 1
- Is there any fft or SVD function in this package? HOT 1
- Will this package support MKL or OpenBlas as backend to accelerate matrix inverse computing speed HOT 1
- [WIP] GenericTensor 2.0 API Design HOT 2
- `Iterate` to return state machine object HOT 1
- Null reference warnings to fix
- Do we need arithmetic operators to be defined?
- ToString shouldn't be called from objects directly
- Document why Forward is needed HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generictensor.