Show HN: Einlang, a math-intuitive language with lots of good stuff(github.com)4 points·by amazing42·3 mesi fa·0 commentsgithub.comShow HN: Einlang, a math-intuitive language with lots of good stuffhttps://github.com/einlang/einlangWith Einlang, you can write codes aslet x = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]] ];let row_sums[..batch, i] = sum[j](x[..batch, i, j]);let loss = sum[..batch, i](row_sums[..batch, i] * row_sums[..batch, i]);let dloss_dx = @loss / @x;Einlang also supports recurrence. You can write codes likelet alpha = 0.25;let x[0] = 8.0;let x[k in 1..6] = { let prev = x[k - 1]; let loss = prev * prev; let g = @loss / @prev; prev - alpha * g };0 commentsPost comment—
let x = [
];
let row_sums[..batch, i] = sum[j](x[..batch, i, j]);
let loss = sum[..batch, i](row_sums[..batch, i] * row_sums[..batch, i]);
let dloss_dx = @loss / @x;
Einlang also supports recurrence. You can write codes like
let alpha = 0.25;
let x[0] = 8.0;
let x[k in 1..6] = {
};