thomasnield
12/01/2021, 3:47 AMAlexandre Brown
12/03/2021, 3:09 AMaltavir
01/19/2022, 8:03 AMGeorge Pandian
01/21/2022, 12:03 PMPeter
02/08/2022, 12:35 PMimport java.math.BigDecimal
val x = BigDecimal("127.0")
val y = BigDecimal("50")
println(x / y) // 2.5 unexpected
println(x.divide(y)) // 2.54 what I expected
Took me while to figure out why what was going on in my code and I cannot see many cases where this is the desired behaviour. Would rather have the div operator just calling the divide method.Slackbot
02/14/2022, 9:18 AMaltavir
02/18/2022, 8:58 AMjvm summary:
Benchmark Mode Cnt Score Error Units
DotBenchmark.bufferedDot thrpt 5 1.017 ± 0.399 ops/s
DotBenchmark.cmDot thrpt 5 0.589 ± 0.348 ops/s
DotBenchmark.cmDotWithConversion thrpt 5 0.627 ± 0.395 ops/s
DotBenchmark.doubleDot thrpt 5 1.168 ± 0.125 ops/s
DotBenchmark.doubleTensorDot thrpt 5 1.263 ± 0.235 ops/s
DotBenchmark.ejmlDot thrpt 5 2.573 ± 0.427 ops/s
DotBenchmark.ejmlDotWithConversion thrpt 5 2.332 ± 0.239 ops/s
DotBenchmark.multikDot thrpt 5 16.067 ± 0.959 ops/s
DotBenchmark.tensorDot thrpt 5 0.614 ± 0.053 ops/s
DotBenchmark.tfDot thrpt 5 3.905 ± 0.541 ops/s
Multik result (cc @Pavel Gorgulov) is a bit surprising. I did not expect it to be much faster than TensorFlow. KMath-core results are good enough for default implementation.altavir
04/12/2022, 9:44 AMAlexandre Brown
05/04/2022, 10:53 AMAlexandre Brown
05/12/2022, 3:03 AMMuhammet Emin Gündoğar
05/25/2022, 6:45 PMfun Int.floorEven() = this and 0x01.inv()
I was reading a project and i saw this code but i could not understand why this code flooring the number to even i know 01 inverse equals to -2 because of 2's complement equals to 1's complement - 1 and 2 complent is negative of that number but i could not understand why this code will always work?Big Chungus
06/07/2022, 4:42 PMBig Chungus
06/07/2022, 8:22 PMBig Chungus
06/10/2022, 12:02 PMaltavir
06/17/2022, 3:00 PMaltavir
06/17/2022, 7:53 PMSam Stone
06/23/2022, 3:53 AMclosest(1.03)=1.05
, closest(1.02)=1.00
, closest(1.05)=1.05
Sam Stone
07/04/2022, 8:34 PMaltavir
07/08/2022, 8:29 AMfunctions
module (it is intended to be lightweight). Could you create a separate module like kmath-rational
and move all but basic polynomials there?David Boney
07/12/2022, 5:34 PMSlackbot
07/12/2022, 6:50 PMaltavir
07/16/2022, 8:34 AMdev
and yes, it can work with tensors and allows custom operators: https://github.com/mipt-npm/kmath/blob/dev/kmath-core/src/commonTest/kotlin/space/kscience/kmath/expressions/DerivativeStructureExpressionTest.kt. Documentation is not ready yet, but any feedback would be welcome.
The difference from Facebook implementation is that operations themselves (including performance optimization) are decoupled from the autodiff algorithm. So you can for example use Multik native implementation with the autodif engine.Stumpos
07/20/2022, 5:55 PMaltavir
07/24/2022, 9:05 AMPavel Gorgulov
07/29/2022, 10:25 AMaltavir
08/04/2022, 6:58 AMMultik.stat
fail by default there. Engines must be loaded manually and it should be mentioned in the documentation.altavir
08/17/2022, 6:01 PMaltavir
10/04/2022, 7:34 AMtensor.lup()
with prefix notations like Algebra::lup(tensor)
. It allows much more robust use of contexts and extensions and in my opinion is much more readable. In numpy/Torch postfix notation is used mostly because it could not be done in the other way. The only thing we loose is easy chaining (it could be brought back via scope functions). Does anybody know a case with real complicated chaining on tensors?Curtis Ullerich
10/06/2022, 3:02 AMnino
11/04/2022, 1:40 PM0.42.rem(0.14)
return 0.13999999999999996
and how can I fix it?nino
11/04/2022, 1:40 PM0.42.rem(0.14)
return 0.13999999999999996
and how can I fix it?0.42.rem(0.14) == 0.0
to false
0.28.rem(0.14) == 0.0
is true
andylamax
11/04/2022, 2:37 PMaltavir
11/04/2022, 2:39 PMnino
11/04/2022, 4:14 PMBigDecimal(0.42).rem(BigDecimal(0.14))
doesn't solve the problemaltavir
11/04/2022, 4:25 PMrequire( abs(0.42.rem(0.14)) < 1e-4))
You can add an extension to do thatnino
11/04/2022, 6:49 PM0.28.rem(0.14) == 0.0
is true though0.56.rem(0.14) == 0.0
altavir
11/04/2022, 7:43 PMnino
11/04/2022, 10:43 PMAndrew
11/16/2022, 6:12 PMBigDecimal.valueOf(0.42).rem(BigDecimal.valueOf(0.14))