Giter Club home page Giter Club logo

acme's People

Contributors

dependabot[bot] avatar fl03 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

acme's Issues

Create a basic web-framework expanding upon hyper_wasi / tokio_wasi

  • Routers
  • Server Wrapper
  • Application Frame

Acme provides several useful utilities for creating cloud-native Web applications within Rust, leveraging the native WebAssembly support and advancements within the WASI api for optimal performance, reduced overhead, and more.

Implement various iterators for the Tensor

Standard

The base iterator should visit the elements in logical order; meaning that an element located at [0, .., 0] should be the first element, [0, .., 1] would be second, and ending in [m, n]

Introduce a Tensor object

Tensors are mathematical objects often used to describe physical properties. Considering the limitations of the Rust procedural macros, Tensors become more important as they may be used to aid in implementing an automatic differentiation suite as well as the machine-learning library, concision.

  • Tensors are n-dimensional.

Applications

When building dynamic compute graphs, nodes are considered to be tensors while the edges represent operations. Building a sufficiently robust tensor object is fundamental when attempting to build a complete artificial intelligence and machine learning system.

Explore potential applications for a macro that maps variables to a gradient

It may be possible to generate a macro that represents the gradient;

extern crate acme;

use acme::operator;

fn main() {
    let dx = mul_gradient!(x: 10f64);

    let (x, y) = (3f64, 4f64);
    let dx = mul_gradient!(x);
    let dy = mul_gradient!(y);

    assert_eq!(dx, y);
    assert_eq!(dy, x);
}

#[operator]
pub fn mul<A, B, C>(x: A, y: B) -> C where A: core::ops::Mul<B, Output = C> {
    x * y
}

Create a framework for building dynamic automata

An automata is formally described with the 5-tuple consisting of the elements defined below:

  • (Sigma) Input alphabet
  • (Tau) output alphabet
  • (Q) Finite set of states
  • (Dirac) Transition functions
  • (Gamma) Next-Output Function

Explore WebRTC

"WebRTC (Web Real-Time Communication) is a technology that enables Web applications and sites to capture and optionally stream audio and/or video media, as well as to exchange arbitrary data between browsers without requiring an intermediary. The set of standards that comprise WebRTC makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user install plug-ins or any other third-party software." MDN

Create a cloud-native application framework

One of the primary resolves of the crate is to support the creation of cloud-native applications written in Rust leveraging the Axum web-framework alongside a module command line interface leveraging Clap

Implement a gradient macro

Considering certain limitations of Rust when using procedural macros, an attribute macro will be better suited as they are permitted the full scope of whatever logic is encompassed by the function definition.

Usage

use acme::grad;

#[grad]
fn add(x: f64, y: f64) -> f64 {
    x + y
}

fn main() {
    println!("{:?}", add_prime(2_f64, 0));
}

Tensor: implement statistical summary methods

Summary statistics provide quick summary of the provided information.

Methods

Each of the following methods should also be capable of being applied along a given axis; denoted with the _axis suffix.

  • Mean
  • Median
  • Mode
  • Standard Deviation
  • Variance

Extend support for function calls

The autodiff procedural macro correctly evaluates logic contained within the macro but cannot handle previously defined logic. Specifically, invoked functions and undefined method_ calls both fail to provide the system with enough information to process the contained logic.

Example

Writing the logic for the sigmoid function within the macro works.

use acme::autodiff;

fn main() {
    let (x, y) = (1_f64, 2_f64);
    assert!(autodiff!(x, 1.0 / (1.0 + (-x).exp())) == 0.1049935854035065);
}

However, invoking a function (or even non-described methods) fails to evaluate correctly since the parsed input fails to store any meaningful information about the function.

use acme::autodiff;
use acme::prelude::sigmoid;

fn main() {
    let (x, y) = (1_f64, 2_f64);
    assert!(autodiff!(x, sigmoid(x)) != 0.1049935854035065);
}

Methods

Traditional macro libraries and methods seem to lack explicit support for engaging with these objects. At initial glance, the problem may require using lower-level Rust libraries to interact with the compiler but support for this is also limited.

Extracting the logic from the SourceFile

One approach would be to use the span of the expression to locate the resource and extract the required information.

Option 2: Rewrite the logic as a #[proc_macro_attribute]

#[gradient]
pub fn multiply<A, B, C>(a: A, b: B) -> C 
where 
    A: std::ops::Mul<B, Output = C> 
{ 
    a * b 
}

By writing a #[proc_macro_attribute] any implemented functions could have a gradient function automatically generated. One of the primary issues with this is that we still run into the issue at hand when any external logic is invoked at any point within the function definition.

Option 3: Create an additional generator which rewrites the function as a closure

Update the macros to properly account for arrays

extern crate acme;

use acme::autodiff;

#[test]
fn test_array() {
    let x = [1.0, 2.0];
    let y = [2.0, 2.0];
    assert_eq!(autodiff!(x: x + y), 1f64);
    // panics here
    // assert_eq!(autodiff!(x: x + y), [1.0, 0.0]);

}

Create a set of integrated procedural macros for building differentiable functions, methods, etc.

Example

extern crate acme;

use acme::{autodiff, operator};

fn main() {
    let x = 5f64;
    let (z, dz) = (sigmoid(x), sigmoid_prime(x));
    assert_eq!(autodiff!(lex x: sigmoid_lexical()), dz);
}

#[operator(partial)]
pub fn sigmoid<T>(x: T) -> T where T: num::Float {
    x.exp() / (T::one() + x.exp())
}

pub fn sigmoid_prime<T>(x: T) -> T where T: num::Float {
    sigmoid(x) * (1 - sigmoid(x)
}

Try to integrate with the #[operator] macro by collecting the String created by invoking _lexical()

Create a slicer for the Tensor

Usage

extern crate acme;

use acme::prelude::{IntoShape, Tensor, TensorResult};

fn main() -> TensorResult<()> {
    let shape = (3, 3).into_shape();
    let n = shape.size();
    let tensor = Tensor::linspace(0f64, n as f64, n).reshape(shape)?;
    let elem = tensor[[0, 0]];
    let slice = tensor[[0, ..]];
    Ok(())
}

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.