DeepSharp.Pipelines 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DeepSharp.Pipelines --version 0.2.0
                    
NuGet\Install-Package DeepSharp.Pipelines -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeepSharp.Pipelines" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DeepSharp.Pipelines" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="DeepSharp.Pipelines" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DeepSharp.Pipelines --version 0.2.0
                    
#r "nuget: DeepSharp.Pipelines, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DeepSharp.Pipelines@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DeepSharp.Pipelines&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=DeepSharp.Pipelines&version=0.2.0
                    
Install as a Cake Tool

<img src="https://raw.githubusercontent.com/xkqg/DeepSharp/main/assets/icon.png" width="96" align="right" alt="" />

DeepSharp — deep learning in C#

The best of both worlds: TensorFlow's way of describing a network, PyTorch's way of running it.

DeepSharp is the C# layer over the engines that already exist. You describe, train and use a network in C#, and the arithmetic runs on whichever engine suits the job — .NET's own vector maths out of the box, libtorch through TorchSharp when the work gets bigger. Swapping between them does not change a line of your model.

What DeepSharp adds is everything around the engine. Getting your data in, the layers, the training loop, the checkpoints, the metrics and the pictures. An engine gives you fast arithmetic; it does not give you a way to describe a network in C#, feed it real data, watch it learn and save the result.

using DeepSharp.Tensors;

var maths = new CpuBackend();

var a = Tensor.From(new Shape(2, 2), [1f, 2f, 3f, 4f]);
var b = Tensor.From(new Shape(2, 2), [10f, 20f, 30f, 40f]);

var sum = maths.Add(a, b);   // 11, 22, 33, 44

Pipeline-driven design

The course from raw data to a validated model is always the same — collect, add features, normalise, deal with the gaps, split into training, validation and test, build, and check against data it has never seen. DeepSharp asks you to declare that course in advance as one artefact rather than perform it, and then replays it. The rule that makes it worth doing: anything that learns from the data is fitted on the training split alone and replayed unchanged.

The wiki has both halves: PDD for the idea and the mistake it removes, Pipeline for the verbs themselves.

Version 0.2.0 — what is here today

The first release was the tensors. This one is the data half: everything a set of rows goes through before a model sees it, written down once as a file you can save, hand over and replay. What it contains works and is tested; everything above describes where it is going, and the changelog records what each release actually added.

What it does
Shape Says how big a tensor is — 2x3 is two rows of three. Tells you off straight away if the sizes do not match.
Tensor The numbers themselves, laid out in that shape. Once made it never changes, so it is safe to reuse.
ITensorBackend Which engine does the arithmetic. Your model is written against this, not against an engine.
CpuBackend The engine that needs no installing: your processor's vector instructions, through .NET's own maths.
DeepSharp.Pipelines The data half: say where the rows come from, what the columns are, which features are worked out, where the split falls, how gaps are filled and how the numbers are scaled — then save all of it as a file and read it back unchanged.
DeepSharp.Pipelines.DataFrame One reader for the long tail: anything that can fill a DataFrame — a CSV, a database query, rows already in hand — comes in through it.
DeepSharp.Pipelines.Indicators Indicators over a series, borrowed from the published MatPlotLibNet packages rather than written again.
using DeepSharp.Pipelines;

var declaration = Pdd.Create()
    .ReadCsv("btceur-1d.csv")                                   // declared, not opened
    .SplitByTime("timestamp", train: 0.70, validation: 0.15)      // test is the rest: 0.15
    .FillMissing("trades", With.Mean)                           // only offered after the split
    .Declaration;

File.WriteAllText("btceur.pdd.json", declaration.ToJson());

Next come the features, the normalisers and the report, then gradients, the layers, the optimizers and the training loop — see the roadmap.

Next to TorchSharp and TensorFlow.NET

Those are bindings: PyTorch's or TensorFlow's own interface written in C#, with the original engine underneath. They are excellent at being that, and DeepSharp is happy to use one. What they do not give you is a library that reads like C#, a way to pour your data in, a training loop you did not write yourself, or a picture of what happened — and because your model talks to a backend rather than to an engine, the choice of engine stays a choice. The wiki has the full comparison.

Getting started

git clone https://github.com/xkqg/DeepSharp.git
cd DeepSharp
dotnet build DeepSharp.slnx -c Release

Runs on .NET 10. The wiki has the walkthrough, what you can build with it, the design decisions and what is planned. CONTRIBUTING.md has the rules for changing anything here: a failing test first, no warnings, and a coverage check that fails rather than reports.

Licence

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (11)

Showing the top 5 NuGet packages that depend on DeepSharp.Pipelines:

Package Downloads
DeepSharp.Pipelines.Indicators

Financial and signal-processing indicators as pipeline features, borrowed from MatPlotLibNet rather than written again: moving averages, RSI, ATR, ADX, MACD, Bollinger bands, stochastic, VWAP and more, each arriving as one or more columns before the split because an indicator learns nothing from the data as a whole. Two properties are tested rather than promised — the window only looks backwards, and the warm-up is an absence rather than a value.

DeepSharp.Pipelines.DataFrame

Reads a DeepSharp pipeline's rows out of Microsoft's DataFrame, Microsoft.Data.Analysis, or out of anything that can fill one: a comma-separated file, a database query, rows somebody already had. One reader for the long tail of formats, so the pipeline itself needs none of them. A comma-separated file comes through as the text it writes, so the pipeline's own schema decides what each column holds, and a database query says what its columns hold as the database types them. An absent value stays absent rather than becoming a not-a-number, because never-there and arithmetic-went-wrong are different answers.

DeepSharp.Learners.Networks

Where a DeepSharp network meets a DeepSharp pipeline: a network learns from the rows the pipeline hands over from its training split, every feature on one scale, is judged by its validation rows and never sees its test rows; the pipeline's report measures it in the answer's own units; what it predicts for a row served later comes back as a value, a probability, a price or a count, as the pipeline's way back gives it. The network and the pipeline it was trained behind are one file, which refuses to be read beside any other fit of that pipeline — and a checkpoint is the same file with what the run needs to go on.

DeepSharp.Verso.Notebooks

A DeepSharp pipeline written as a notebook in Verso, one block per step. The first block reads a comma-separated file, a Parquet file, a sheet of an Excel workbook or a JSON file, and the package brings those readers with it. Each block is the step's own JSON, edited as text or in Verso's properties panel, and shows the data at that point on request: a grid coloured per column over the training rows, a profile that names what should not be there and how each is answered, with a box that gives an answer which changes the columns, and a heatmap of the complete training rows. Columns are chosen from the grid or from a list of the source's columns, which says what each column's cells propose it holds, and the decisions are saved beside the notebook and taken over again. The notebook is the declaration — exported as the same pipeline file, and handed to C# cells as text. It runs in Verso's VS Code extension, in verso serve, in DeepSharp's own server deepsharp-serve and in an application of your own.

DeepSharp.Charts

The charts of a DeepSharp run, drawn from what the training loop and the measures already keep, never from arrays anybody assembles: the loss curve of the training and the validation rows, the learning rate every epoch took, a confusion matrix as a heatmap of counts, what a model predicted against what was there, what was left over, every measure as bars beside the training rows' average, and a correlation as a heatmap. Each chart is handed out as the text of an SVG, drawn by MatPlotLibNet, and kept in a package of its own so a trainer on a machine with no screen never carries a renderer.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 199 10/6/2026
0.7.1 241 10/6/2026
0.7.0 278 10/4/2026
0.6.1 252 10/4/2026
0.5.0 253 10/1/2026
0.4.0 194 9/30/2026
0.3.0 152 9/29/2026
0.2.0 128 9/23/2026