From 2cf0667d971ec9b8d2d1f7e4c5aa58cd1c909ef2 Mon Sep 17 00:00:00 2001 From: "nohz.afk" <149959021+nohzafk@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:21:58 +0800 Subject: [PATCH] rename files --- src/{malt1.gleam => flat_tensor.gleam} | 0 src/iris.gleam | 2 +- src/{malt0.gleam => nested_tensor.gleam} | 0 ...malt1_test.gleam => flat_tensor_test.gleam} | 18 +++++++++--------- test/iris_test.gleam | 2 +- ...lt0_test.gleam => nested_tensor_test.gleam} | 14 +++++++------- 6 files changed, 18 insertions(+), 18 deletions(-) rename src/{malt1.gleam => flat_tensor.gleam} (100%) rename src/{malt0.gleam => nested_tensor.gleam} (100%) rename test/{malt1_test.gleam => flat_tensor_test.gleam} (99%) rename test/{malt0_test.gleam => nested_tensor_test.gleam} (98%) diff --git a/src/malt1.gleam b/src/flat_tensor.gleam similarity index 100% rename from src/malt1.gleam rename to src/flat_tensor.gleam diff --git a/src/iris.gleam b/src/iris.gleam index 39839ba..f7be9b9 100644 --- a/src/iris.gleam +++ b/src/iris.gleam @@ -3,7 +3,7 @@ import gleam/io import gleam/list import gleam/string import iris_data -import malt0.{ +import nested_tensor.{ type Block, type Hyperparameters, Block, accuracy, grid_search, init_theta, l2_loss, model, relu, sampling_obj, stack_blocks, tensor, } diff --git a/src/malt0.gleam b/src/nested_tensor.gleam similarity index 100% rename from src/malt0.gleam rename to src/nested_tensor.gleam diff --git a/test/malt1_test.gleam b/test/flat_tensor_test.gleam similarity index 99% rename from test/malt1_test.gleam rename to test/flat_tensor_test.gleam index 5112c8a..31ef54d 100644 --- a/test/malt1_test.gleam +++ b/test/flat_tensor_test.gleam @@ -1,12 +1,4 @@ -import gleam/bit_array -import gleam/bool -import gleam/dynamic.{type Dynamic} -import gleam/float -import gleam/int -import gleam/list -import gleam_community/maths/elementary.{exponential, natural_logarithm} -import gleeunit/should -import malt1.{ +import flat_tensor.{ type Differentiable, type Dual, type Shape, type Tensor, Dual, DualDiff, ListDiff, add_numeric, bitarray_to_floats, build_store, build_tensor, d_add, d_divide, d_exp, d_expt, d_log, d_multiply, d_sqr, d_sqrt, d_subtract, @@ -17,6 +9,14 @@ import malt1.{ tensor_equal, tlen, to_bitarray, to_diff, to_dual, to_tensor, tref, trefs, unwrap_ok_number, unwrap_ok_number2, } +import gleam/bit_array +import gleam/bool +import gleam/dynamic.{type Dynamic} +import gleam/float +import gleam/int +import gleam/list +import gleam_community/maths/elementary.{exponential, natural_logarithm} +import gleeunit/should pub fn scalar1_shape(_) { [] diff --git a/test/iris_test.gleam b/test/iris_test.gleam index 633db8c..a5faf88 100644 --- a/test/iris_test.gleam +++ b/test/iris_test.gleam @@ -1,6 +1,6 @@ import gleam/io import iris -import malt0 +import nested_tensor import qcheck_gleeunit_utils/test_spec // only takes 10 seconds to run all the grid_search on M3 Max // pub fn grid_search_test_() { diff --git a/test/malt0_test.gleam b/test/nested_tensor_test.gleam similarity index 98% rename from test/malt0_test.gleam rename to test/nested_tensor_test.gleam index 1a652bb..45b2b40 100644 --- a/test/malt0_test.gleam +++ b/test/nested_tensor_test.gleam @@ -9,13 +9,13 @@ import gleam/result import gleam/string import gleam_community/maths/combinatorics import gleeunit/should -import malt0.{ +import nested_tensor.{ type Scalar, type Tensor, type Theta, Block, ListTensor, Scalar, ScalarTensor, accuracy, adam_gradient_descent, add_0_0, build_tensor, - build_tensor_from_tensors, compose_block_fns, corr, correlation_overlap, - desc_t, desc_u, dot_product, dotted_product, ext1, ext2, get_float, get_real, - get_scalar, gradient_descent, gradient_of, gradient_once, hp_new, - hp_new_batch_size, hp_new_beta, hp_new_mu, init_shape, k_recu, l2_loss, + build_tensor_from_tensors, cartesian_product, compose_block_fns, corr, + correlation_overlap, desc_t, desc_u, dot_product, dotted_product, ext1, ext2, + get_float, get_real, get_scalar, gradient_descent, gradient_of, gradient_once, + hp_new, hp_new_batch_size, hp_new_beta, hp_new_mu, init_shape, k_recu, l2_loss, make_theta, map_tensor, map_tensor_recursively, multiply_0_0, naked_gradient_descent, new_scalar, plane, rank, rectify, rectify_0, recu, relu, rms_gradient_descent, samples, sampling_obj, shape, smooth, stack2, @@ -1125,7 +1125,7 @@ pub fn cartesian_product_test() { }), ) - malt0.cartesian_product([list1, list2, list3]) + cartesian_product([list1, list2, list3]) |> should.equal( [ #(500, 0.0001, 4), @@ -1145,7 +1145,7 @@ pub fn cartesian_product_test() { // The result will be a list of lists, each containing one element from each input list let r = - malt0.cartesian_product([ + cartesian_product([ [500, 1000] |> list.map(dynamic.from), [0.0001, 0.0002] |> list.map(dynamic.from), [4, 8] |> list.map(dynamic.from),