torchtyping VS marshal.ts

Compare torchtyping vs marshal.ts and see what are their differences.

torchtyping

Type annotations and dynamic checking for a tensor's shape, dtype, names, etc. (by patrick-kidger)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
torchtyping marshal.ts
7 29
1,337 3,071
- 0.9%
3.2 9.6
11 months ago 8 days ago
Python TypeScript
Apache License 2.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

torchtyping

Posts with mentions or reviews of torchtyping. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-02-11.
  • [D] Have their been any attempts to create a programming language specifically for machine learning?
    12 projects | /r/MachineLearning | 11 Feb 2023
    Not really an answer to your question, but there are Python packages that try to solve the problem of tensor shapes that you mentioned, e.g. https://github.com/patrick-kidger/torchtyping or https://github.com/deepmind/tensor_annotations
  • What's New in Python 3.11?
    14 projects | news.ycombinator.com | 26 Jun 2022
    I disagree. I've had a serious attempt at array typing using variadic generics and I'm not impressed. Python's type system has numerous issues... and now they just apply to any "ArrayWithNDimensions" type as well as any "ArrayWith2Dimenensions" type.

    Variadic protocols don't exist; many operations like stacking are inexpressible; the synatx is awful and verbose; etc. etc.

    I've written more about this here as part of my TorchTyping project: [0]

    [0] https://github.com/patrick-kidger/torchtyping/issues/37#issu...

  • Can anyone point out the mistakes in my input layer or dimension?
    1 project | /r/learnmachinelearning | 6 Jun 2022
    also https://github.com/patrick-kidger/torchtyping
  • [D] Anyone using named tensors or a tensor annotation lib productively?
    2 projects | /r/MachineLearning | 18 Apr 2022
    FWIW I'm the author of torchtyping so happy to answer any questions about that. :) I think people are using it!
  • [D] Ideal deep learning library
    9 projects | /r/MachineLearning | 5 Jan 2022
    The one thing I really *really* wish got more attention was named tensors and the tensor type system. Tensor misalignment errors are a constant source of silently-failing bugs. While 3rd party libraries have attempted to fill this gap, it really needs better native support. In particular it seems like bad form to me for programmers to have to remember the specific alignment and broadcasting rules, and then have to apply them to an often poorly documented order of tensor indices. I'd really like to see something like tsalib's warp operator made part of the main library and generalized to arbitrary function application, like a named-tensor version of fold. But preferably using notation closer to that of torchtyping.
  • [P] torchtyping -- documentation + runtime type checking of tensor shapes (and dtypes, ...)
    2 projects | /r/MachineLearning | 7 Apr 2021
    Yes it does work with numerical literals! It support using integers to specify an absolute size, strings to specify names for dimensions that should all be consistently sized (and optionally also checks named tensors), "..." to indicate batch dimensions, and so on. See the full list here.

marshal.ts

Posts with mentions or reviews of marshal.ts. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-15.
  • Deepkit Enterprise TypeScript Framework
    1 project | news.ycombinator.com | 9 Dec 2023
  • We use TypeScript not based on preference, but because we want to make money
    3 projects | news.ycombinator.com | 15 Sep 2023
    zod or yup gets you quite a bit of the way there in practice - when you would reach for a Typescript type, making it in zod instead is more verbose but gives that runtime layer.

    But for those who actually want full-stack non-stripped runtime type reflection based on Typescript syntax alone... https://deepkit.io/ - https://deepkit.io/blog/introducing-deepkit-framework - is a really promising and cool project.

    It patches the typescript compiler (which pointedly considers runtime type information out of scope) with its own type compiler that emits a bespoke bytecode that is executed in a bespoke VM to communicate runtime type information to both server and client as needed. https://docs.deepkit.io/english/runtime-types.html

    And from that baseline, there are very cool things you can do like an ORM entirely based on type annotations https://docs.deepkit.io/english/database.html or strongly-typed RPCs https://docs.deepkit.io/english/rpc.html .

    It's very much in the alpha stage, but it's really well thought out - there's a tremendous degree of care the developer is taking towards code cleanliness and developer experience. I'm torn between wishing this project to have a fully funded team and take the world by storm, vs. "letting them cook" so to speak and seeing the developer experience unfold organically. Either way, it's a breath of fresh air into the Typescript ecosystem!

  • Is there a TS backend development environment similar to what I have for the frontend?
    3 projects | /r/typescript | 8 Jul 2023
  • TypeScript please give us types
    10 projects | news.ycombinator.com | 7 Jul 2023
    Deepkit (listed in the article) is a fascinating project and really deserves to be more popular.

    It also demonstrates that what is being asked for is actually practical.

    https://deepkit.io/

  • Bebop introduces JSON-Over-Bebop for fast runtime type validation of raw JSON in Typescript; faster than Zod and other alternatives
    3 projects | /r/typescript | 27 Jun 2023
    Checkout deepkit One of the things it has is a really fast BSON parser, that is faster than the JSON one to my understanding. Interesting work with TS types too
  • Show HN: Magma – Multiplayer AI for Artists
    1 project | news.ycombinator.com | 31 May 2023
    Hello HN community! I’m one of the founders of Magma, a multiplayer art platform. You might recall our earlier post (https://news.ycombinator.com/item?id=30869131), and today we’re sharing a significant update with our artist-focused, multiplayer AI assistant, a first in the realm of collaborative creative tools. Hope you’ll like it!

    See how it works in this YouTube video: https://www.youtube.com/watch?v=ZESJfjwxLjk. For in-depth understanding, here’s our documentation (https://help.magma.com/en/articles/6711598-beta-ai-assistant) and our AI manifesto (https://magma.com/aimanifesto) which is a guiding document for us.

    We're inviting you to get hands-on with this new feature. Join any of these canvases (up to 50 live contributors each): https://magm.ai/qnss, https://magm.ai/ei74, https://magm.ai/38mr, https://magm.ai/z1ti, https://magm.ai/zdub, https://magm.ai/ed93, https://magm.ai/1l84, https://magm.ai/xvu5, https://magm.ai/gd9j, https://magm.ai/pu6e. All of these canvases have extra feature flags enabled but if you’d like to go beyond them, feel free to join our beta community https://magm.ai/magma-beta-artspace-invite

    Our artist-first approach is rooted in our belief that human creativity should remain the heart of artistry. With our AI handling routine tasks, artists can focus on true creativity. Importantly, our AI preserves artists' copyright as it provides a clear distinction between human-generated and AI-generated content.

    Beyond just art, Magma is a powerful tool for game dev and animation, offering powerful design & review tools for all stages of the creative process. Our Slack/GDrive-like workspaces (we call them Artspaces) expose API and even shell tools. One can even render any artwork in the terminal. :)

    Technically speaking, our collaborative drawing engine is powered by Typescript, Node.JS, WebGL, with a hint of WebAssembly for hand-optimized performance that even Chromebooks can handle. The backend also leverages a high performance Typescript Deepkit Framework https://deepkit.io

    Our AI assistant runs on a worker-based architecture akin to Gitlab CI workers, currently leveraging Stable Diffusion 2.1. Future developments will allow connecting your own AI worker, training custom models within Magma, and plugging in API keys from other AI backends.

    Feedback, questions, thoughts? Let's discuss! Happy creating with a helping hand of AI!

    P.S. A shout-out to the HN community, our last post here helped us connect with an amazing technical angel investor who has made significant contributions. Looking forward to more such productive connections!

  • Why nodejs engineers prefer express over nestjs? although nestjs forces good practice and proper architecture and it seems to be a right choice for complex and enterprise applications like asp.net and Spring. What are the limitations of nestjs compared to express?
    3 projects | /r/node | 26 May 2023
    Take a look at restfuncs then. Or deepkit or telefunc.
  • Runtime TypeScript types change everything
    5 projects | /r/typescript | 13 May 2023
    Both work out of the box very well with Deepkit. You can either construct your own types in runtime or mix TS types with runtime information. See for example https://github.com/deepkit/deepkit-framework/blob/master/packages/framework/src/crud.ts where this is done
  • IS there a way to generate Swagger model schemas from interfaces
    2 projects | /r/typescript | 18 Apr 2023
    Yes, you can directly use the interfaces and types as is with Deepkit (https://deepkit.io) and the library deepkit-openapi. You get also full route documentation if you use the deepkit/http router where you can use interfaces and type aliases plus validation thpes for route parameters (query parameters, body, etc). It still in alpha, but approaches soon beta.
  • Hegel – An advanced static type checker for JavaScript
    12 projects | news.ycombinator.com | 11 Oct 2022
    https://deepkit.io/ may be of interest to you! It deeply patches the TS type compiler to make all types visible at runtime, enabling a lot of annotation-style workflows and dependency injection possible completely within the type annotation system: https://docs.deepkit.io/english/runtime-types.html

    Previous discussion: https://news.ycombinator.com/item?id=31663298 - it's downright mindblowing that all this seems to be the work of primarily a single developer.

    For a less intrusive solution, https://github.com/jquense/yup is a great library to reach for whenever you're defining the shape of a network-transmitted object and don't want to introduce compilation stages.

What are some alternatives?

When comparing torchtyping and marshal.ts you can also consider the following projects:

jaxtyping - Type annotations and runtime checking for shape and dtype of JAX/NumPy/PyTorch/etc. arrays. https://docs.kidger.site/jaxtyping/

ts-jackson - A typescript library to deserialize and serialize json into classes. You can use different path pattern to resolve deeply nested structures. Every path pattern provided by lodash/get|set object is supported. Check out src/examples as a reference.

equinox - Elegant easy-to-use neural networks + scientific computing in JAX. https://docs.kidger.site/equinox/

Quarkus - Quarkus: Supersonic Subatomic Java.

tsalib - Tensor Shape Annotation Library (numpy, tensorflow, pytorch, ...)

new-error - Production-grade error creation and serialization library designed for Typescript

mypy - Optional static typing for Python

polka - A micro web server so fast, it'll make you dance! :dancers:

functorch - functorch is JAX-like composable function transforms for PyTorch.

FizzBuzz Enterprise Edition - FizzBuzz Enterprise Edition is a no-nonsense implementation of FizzBuzz made by serious businessmen for serious business purposes.

tensor_annotations - Annotating tensor shapes using Python types

Koa - Expressive middleware for node.js using ES2017 async functions