diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/README.md b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/README.md new file mode 100644 index 000000000000..031dcfaf352c --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/README.md @@ -0,0 +1,220 @@ + + +# logGradient + +> Compute the [log loss gradient][log-loss-gradient] with respect to the predicted value. + +
+ +The [log loss gradient][log-loss-gradient] is defined as + + + +```math +\frac{\partial L}{\partial p} = -\frac{y}{1+e^{yp}} +``` + + + +
+ + + +
+ +## Usage + +```javascript +var logGradient = require( '@stdlib/ml/base/loss/float64/log-gradient' ); +``` + +#### logGradient( y, p ) + +Computes the [log loss gradient][log-loss-gradient] with respect to the predicted value. + +```javascript +var v = logGradient( 1.0, 0.782 ); +// returns ~-0.314 + +v = logGradient( 1.0, -0.999 ); +// returns ~-0.731 +``` + +If either argument is `NaN`, the function returns `NaN`. + +```javascript +var v = logGradient( NaN, 0.782 ); +// returns NaN + +v = logGradient( 1.0, NaN ); +// returns NaN +``` + +If `y` is not +1 or -1, the function returns `NaN`. + +```javascript +var v = logGradient( -0.9, 1.0 ); +// returns NaN + +v = logGradient( 0.453, 0.76 ); +// returns NaN +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var logGradient = require( '@stdlib/ml/base/loss/float64/log-gradient' ); + +var y = sample( [ -1.0, 1.0 ], { + 'size': 100 +}); +var p = uniform( 100, -5.0, 5.0, { + 'dtype': 'float64' +}); + +logEachMap( 'logGradient(%0.4f, %0.4f) = %0.4f', y, p, logGradient ); + +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/ml/base/loss/float64/log_gradient.h" +``` + +#### stdlib_base_float64_log_gradient( y, p ) + +Computes the [log loss gradient][log-loss-gradient] with respect to the predicted value. + +```c +double out = stdlib_base_float64_log_gradient( 1.0, 0.782 ); +// returns ~-0.314 +``` + +The function accepts the following arguments: + +- **y**: `[in] double` true target value. +- **p**: `[in] double` predicted value. + +```c +double stdlib_base_float64_log_gradient( const double y, const double p ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/ml/base/loss/float64/log_gradient.h" +#include + +int main( void ) { + const double y[] = { -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; + const double p[] = { -5.0, -3.89, -2.78, -1.67, -0.56, 0.56, 1.67, 2.78, 3.89, 5.0 }; + + double v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_float64_log_gradient( y[ i ], p[ i ] ); + printf( "logGradient(%lf, %lf) = %lf\n", y[ i ], p[ i ], v ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/benchmark.js b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/benchmark.js new file mode 100644 index 000000000000..ed6a7063955e --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/benchmark.js @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pkg = require( './../package.json' ).name; +var logGradient = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var len; + var y; + var p; + var v; + var i; + + len = 100; + y = sample( [ -1.0, 1.0 ], { + 'size': len + }); + p = uniform( len, -2.0, 2.0 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = logGradient( y[ i%y.length ], p[ i%p.length ] ); + if ( isnan( v ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( v ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/benchmark.native.js new file mode 100644 index 000000000000..1469687ac678 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/benchmark.native.js @@ -0,0 +1,69 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var logGradient = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( logGradient instanceof Error ) +}; + + +// MAIN // + +bench( format( '%s::native', pkg ), opts, function benchmark( b ) { + var len; + var y; + var p; + var v; + var i; + + len = 100; + y = sample( [ -1.0, 1.0 ], { + 'size': len + }); + p = uniform( len, -2.0, 2.0 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = logGradient( y[ i%y.length ], p[ i%p.length ] ); + if ( isnan( v ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( v ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/c/native/Makefile new file mode 100644 index 000000000000..979768abbcec --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/c/native/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/c/native/benchmark.c new file mode 100644 index 000000000000..5d542af402cc --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/benchmark/c/native/benchmark.c @@ -0,0 +1,157 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/ml/base/loss/float64/log_gradient.h" +#include +#include +#include +#include +#include + +#define NAME "log_gradient" +#define ITERATIONS 1000000 +#define REPEATS 3 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param elapsed elapsed time in seconds +*/ +static void print_results( double elapsed ) { + double rate = (double)ITERATIONS / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", ITERATIONS ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [min,max). +* +* @param min minimum value (inclusive) +* @param max maximum value (exclusive) +* @return random number +*/ +static double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +/** +* Randomly samples either +1 or -1. +* +* @return randomly sampled value (+1 or -1) +*/ +static double random_sample( void ) { + double v = (double)rand() / ( (double)RAND_MAX ); + if ( v >= 0.5 ) { + return 1.0; + } + return -1.0; +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + double elapsed; + double *p; + double *y; + double v; + double t; + int i; + + y = (double *) malloc( 100 * sizeof( double ) ); + p = (double *) malloc( 100 * sizeof( double ) ); + for ( i = 0; i < 100; i++ ) { + y[ i ] = random_sample(); + p[ i ] = random_uniform( -2.0, 2.0 ); + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + v = stdlib_base_float64_log_gradient( y[ i % 100 ], p[ i % 100 ] ); + if ( v != v ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( v != v ) { + printf( "should not return NaN\n" ); + } + free( y ); + free( p ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int i; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + for ( i = 0; i < REPEATS; i++ ) { + printf( "# c::native::%s\n", NAME ); + elapsed = benchmark(); + print_results( elapsed ); + printf( "ok %d benchmark finished\n", i+1 ); + } + print_summary( REPEATS, REPEATS ); +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/binding.gyp b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/repl.txt b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/repl.txt new file mode 100644 index 000000000000..b0edacce2e72 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/repl.txt @@ -0,0 +1,37 @@ + +{{alias}}( y, p ) + Computes the log loss gradient with respect to the predicted value. + + If any argument is `NaN`, the function returns `NaN`. + + If `y` is not +1 or -1, the function returns `NaN`. + + Parameters + ---------- + y: number + True target value. + + p: number + Predicted value. + + Returns + ------- + v: number + Log loss gradient. + + Examples + -------- + > var v = {{alias}}( 1.0, 0.782 ) + ~-0.314 + > v = {{alias}}( 1.0, 0.202 ) + ~-0.45 + > v = {{alias}}( 1.0, -0.999 ) + ~-0.731 + > v = {{alias}}( -1.0, 0.2 ) + ~0.55 + > v = {{alias}}( NaN, 0.987 ) + NaN + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/types/index.d.ts b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/types/index.d.ts new file mode 100644 index 000000000000..c5a3a29a2b1d --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/types/index.d.ts @@ -0,0 +1,61 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Computes the log loss gradient with respect to the predicted value. +* +* ## Notes +* +* - If `y` is not +1 or -1, the function returns `NaN`. +* +* @param y - true target value +* @param p - predicted value +* @returns log loss gradient +* +* @example +* var v = logGradient( 1.0, 0.782 ); +* // returns ~-0.314 +* +* @example +* var v = logGradient( 1.0, 0.202 ); +* // returns ~-0.45 +* +* @example +* var v = logGradient( 1.0, -0.999 ); +* // returns ~-0.731 +* +* @example +* var v = logGradient( -1.0, 0.234 ); +* // returns ~0.558 +* +* @example +* var v = logGradient( -1.0, 0.2 ); +* // returns ~0.55 +* +* @example +* var v = logGradient( 1.0, -0.9 ); +* // returns ~-0.711 +*/ +declare function logGradient( y: number, p: number ): number; + + +// EXPORTS // + +export = logGradient; diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/types/test.ts b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/types/test.ts new file mode 100644 index 000000000000..74ca7fff734b --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/docs/types/test.ts @@ -0,0 +1,58 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import logGradient = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + logGradient( 1.0, 0.782 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + logGradient( true, 0.8975 ); // $ExpectError + logGradient( false, 0.8975 ); // $ExpectError + logGradient( null, 0.8975 ); // $ExpectError + logGradient( undefined, 0.8975 ); // $ExpectError + logGradient( '5', 0.8975 ); // $ExpectError + logGradient( [], 0.8975 ); // $ExpectError + logGradient( {}, 0.8975 ); // $ExpectError + logGradient( ( x: number ): number => x, 0.8975 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + logGradient( 1.0, true ); // $ExpectError + logGradient( 1.0, false ); // $ExpectError + logGradient( 1.0, null ); // $ExpectError + logGradient( 1.0, undefined ); // $ExpectError + logGradient( 1.0, '5' ); // $ExpectError + logGradient( 1.0, [] ); // $ExpectError + logGradient( 1.0, {} ); // $ExpectError + logGradient( 1.0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + logGradient(); // $ExpectError + logGradient( 1.0 ); // $ExpectError + logGradient( 1.0, 0.900, 0.787 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/c/Makefile b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/c/example.c b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/c/example.c new file mode 100644 index 000000000000..3df1d04487fc --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/c/example.c @@ -0,0 +1,32 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/ml/base/loss/float64/log_gradient.h" +#include + +int main( void ) { + const double y[] = { -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; + const double p[] = { -5.0, -3.89, -2.78, -1.67, -0.56, 0.56, 1.67, 2.78, 3.89, 5.0 }; + + double v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_float64_log_gradient( y[ i ], p[ i ] ); + printf( "logGradient(%lf, %lf) = %lf\n", y[ i ], p[ i ], v ); + } +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/index.js b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/index.js new file mode 100644 index 000000000000..40523e216631 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/examples/index.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var logGradient = require( './../lib' ); + +var y = sample( [ -1.0, 1.0 ], { + 'size': 100 +}); +var p = uniform( 100, -5.0, 5.0, { + 'dtype': 'float64' +}); + +logEachMap( 'logGradient(%0.4f, %0.4f) = %0.4f', y, p, logGradient ); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/include.gypi b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "machine learning", + "ml", + "loss", + "float64", + "log", + "log loss", + "log loss gradient", + "gradient", + "double-precision", + "double", + "dbl" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/Makefile b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/addon.c b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/addon.c new file mode 100644 index 000000000000..af0ddc0841fa --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/addon.c @@ -0,0 +1,22 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/ml/base/loss/float64/log_gradient.h" +#include "stdlib/math/base/napi/binary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_float64_log_gradient ) diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/main.c b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/main.c new file mode 100644 index 000000000000..21f2f660913f --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/src/main.c @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/ml/base/loss/float64/log_gradient.h" +#include "stdlib/math/base/assert/is_nan.h" +#include "stdlib/math/base/special/exp.h" +#include "stdlib/constants/float64/nan.h" + +/** +* Computes the log loss gradient with respect to the predicted value. +* +* @param y true target value +* @param p predicted value +* @return log loss gradient +* +* @example +* double out = stdlib_base_float64_log_gradient( 1.0, 0.202 ); +* // returns -2.5 +*/ +double stdlib_base_float64_log_gradient( const double y, const double p ) { + if ( + stdlib_base_is_nan( y ) || stdlib_base_is_nan( p ) || + ( y != -1.0 && y != 1.0 ) + ) { + return STDLIB_CONSTANT_FLOAT64_NAN; + } + return -y / ( 1.0 + stdlib_base_exp( y*p ) ); +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..7c8193c06e65 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/REQUIRE @@ -0,0 +1,2 @@ +julia 1.4.2 +JSON 0.21.0 diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/runner.jl new file mode 100755 index 000000000000..e2e5b288de51 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/runner.jl @@ -0,0 +1,84 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import JSON + +""" + gen( y, p, name ) + +Generate fixture data and write to file. + +# Arguments + +* `y`: response domain +* `p`: prediction domain +* `name::AbstractString`: output filename + +# Examples + +``` julia +julia> y = rand( [-1.0, 1.0], 2001 ) +julia> p = range( -1000.0, 1000.0, 2001 ); +julia> gen( y, p, "data.json" ); +``` +""" +function gen( y, p, name ) + v = -y ./ ( 1.0 .+ exp.( y .* p ) ); + + # Store data to be written to file as a collection: + data = Dict([ + ("y", y), + ("p", p), + ("expected", v) + ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: + outfile = open( filepath, "w" ); + write( outfile, JSON.json(data) ); + write( outfile, "\n" ); + close( outfile ); +end + +# Get the filename: +file = @__FILE__; + +# Extract the directory in which this file resides: +dir = dirname(file); + +# Positive tiny values: +y = rand( [ -1.0, 1.0 ], 503 ) +p = range( 0.0, stop=1e-20, length=503 ); +gen( y, p, "tiny_positive.json" ); + +# Small positive values: +y = rand( [ -1.0, 1.0 ], 503 ) +p = range( 0.0, stop=2.0, length=503 ); +gen( y, p, "small_positive.json" ); + +# Negative tiny values: +y = rand( [ -1.0, 1.0 ], 503 ) +p = range( -1e-20, stop=0.0, length=503 ); +gen( y, p, "tiny_negative.json" ); + +# Small negative values: +y = rand( [ -1.0, 1.0 ], 503 ) +p = range( -2.0, stop=0.0, length=503 ); +gen( y, p, "small_negative.json" ); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/small_negative.json b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/small_negative.json new file mode 100644 index 000000000000..b7a0e446cadb --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/small_negative.json @@ -0,0 +1 @@ +{"expected":[0.11920292202211755,-0.8803781418186003,-0.8799579339795867,0.1204635479881002,-0.8791136934720095,0.1213103440781145,-0.8782643369290859,0.12216226593315319,0.12259015508582918,0.12301933294408214,0.12344980191710496,0.12388156440805247,0.1243146228139503,-0.8752510204743965,0.12518463692750392,0.12562159739773887,0.1260598633078973,-0.8735005629770229,0.12694032090129126,0.12738251729437394,-0.8721739714531139,-0.8717291430034798,-0.8712829950260945,0.1291644748025122,0.12961326879855514,0.1300633892708976,-0.8694851614790455,0.13096761884259428,0.13142173252204298,-0.8681228181622156,0.13233396906046288,-0.8672079035472166,-0.8667484337305863,0.13371238075688333,0.13417454215348443,0.1346380526891713,-0.8648970854145406,-0.8644308699446756,-0.8639632986968991,-0.8634943694756204,-0.8630240800940939,-0.8625524283745216,-0.8620794121481574,-0.8616050292554093,-0.8611292775459434,-0.8606521548787878,-0.8601736591224378,-0.8596937881549601,-0.8592125398640972,-0.8587299121473745,-0.858245902912205,-0.8577605100759957,0.14272626843374572,-0.8567855653206959,-0.8562960092873503,-0.8558050614246694,-0.8553127197016352,0.14518101790213192,-0.8543238466037347,0.14617268877954254,-0.8533293739602237,-0.8528300328462946,0.1476707140868845,0.14817286879357452,0.1486764332166318,-0.8508185907126022,0.1496877989255875,0.15019560403917917,0.15070482652430178,0.1512154682651237,0.15172753113374038,0.15224101699006198,-0.8472440723182992,-0.8467277349561422,0.15379003089921028,0.1543092270577976,0.15482985531690768,0.155351917460963,0.1558754152614064,-0.8435996495234136,-0.8430732751483572,-0.8425454598816091,-0.8420162020047927,-0.8414854998130862,-0.8409533516153384,0.15958024426581602,-0.8398847105061605,-0.8393482142818239,-0.8388102654258655,-0.8382708623172287,-0.8377300033492262,0.1628123130703437,-0.8366439114809212,-0.836098675440144,0.1644480227407132,-0.8350038154052679,0.16554581163991963,0.16609690537908955,0.16664946729974456,-0.8327965011260423,0.16775900155825313,-0.8316840232065118,0.1688744260047337,0.16943435060115522,-0.8300042480241063,0.170558631505946,-0.8288770094479541,0.17168883045854413,-0.8277438474467114,0.17282495814750487,0.17339524853567637,0.17396702499542413,0.17454028878738687,-0.8248849588448991,0.17569128332488,-0.823730983494305,0.17684824188905343,-0.8225710393511205,-0.8219888260586066,-0.8214051170950093,-0.8208199113398778,-0.8202332076908264,0.1803549949363439,0.18094469760752638,-0.8184640986298131,-0.8178713927467564,-0.8172771837330531,-0.816681470597242,0.18391574763322927,-0.8154855280881168,0.18511470317309225,0.18571644233195814,-0.8136803097158083,0.18692444790599258,-0.8124692839460713,0.18813849556481646,-0.8112522127443997,0.18935859192323262,0.18997091034455438,-0.8094152567238254,-0.8087999085456491,-0.8081830444051302,0.19243533639292745,0.19305523452300993,-0.806323349361226,0.19429958537292835,0.1949240393371141,-0.8044499868782136,-0.8038224927039042,0.19680652240776936,-0.8025629410170072,0.19806911752629222,-0.8012973014795838,-0.8006621975737818,-0.8000255703174614,0.20061258070608848,-0.7987477441086688,0.20189345561036667,-0.7974638197871856,0.20318043002569708,0.2038262053533247,0.20447350647717874,0.20512233365579666,0.20577268712465657,-0.7935754329039375,0.2070779737590298,0.20773290727917054,-0.7916106322014205,-0.7909526445642786,-0.7902931297146837,0.21036791241822717,-0.7889695181186522,-0.7883054213025104,0.21236020286527052,-0.786972645640997,0.21369603312858282,0.21436623909937913,0.21503797217212314,-0.7842887677772008,0.21638601910253422,0.21706233263748978,-0.7822598273712472,-0.7815804611477725,-0.7808995689414716,-0.7802171510271283,0.22046679229496985,0.22115226069892516,-0.7781607461668766,0.22252777132012905,0.2232178127565805,0.2239093777130859,-0.7753975342658807,0.22529707633791815,0.2259932090163797,0.22669086323496004,0.22739003843257213,-0.7719092659785148,0.22879294938722428,-0.7705033161115292,0.2302019368569635,-0.7690912924026001,-0.7683830046126612,-0.7676732005228976,0.23303811908968142,0.23375095342063712,-0.7655346983619923,0.23518116288221366,-0.7641014637340369,0.2366174208741599,0.23733781576381002,0.23805971996393083,-0.7612168675245402,-0.7604919477288361,0.240234478295551,0.2409624094647805,-0.7583081553334244,-0.7575772172398645,0.2431552225760507,0.2438891629162154,0.24462460255374377,0.24536154023288614,-0.753900025331055,0.24683990454819357,-0.7524186714722063,0.24832424523571567,0.24906865327065797,-0.7501854487980312,-0.7494380624304322,-0.7486891891161309,0.2520611696257049,0.25281301224625036,0.25356633716694904,-0.7456788572205606,-0.7449225725545173,0.25583518949689027,-0.7434055727645453,0.25735513893287826,-0.7418826771692943,-0.7411190228597445,0.25964610004255406,0.26041268968826914,-0.7388192558023541,-0.7380497383395574,-0.7372787598641314,-0.7365063223474777,-0.7357324277916693,-0.7349570782295098,0.2658197242754076,0.2665979776286435,0.2673776797048556,-0.7318411716522565,-0.7310585786300049,0.2697254565532331,-0.7294890683520363,-0.7287021556264744,0.2720861924180408,-0.7271240265616343,-0.7263328149399553,0.2744598248772632,0.2752538904528037,-0.7239506206819988,0.2768462889727015,0.27764461688521946,-0.721555639507701,-0.7207544828009255,0.2800480843790327,-0.7191479406260229,-0.7183425605060082,0.2824642220174085,-0.7167275958092264,0.28408198322881667,0.28489295631442063,-0.7142946794014071,0.28651907320043773,-0.7126657887928697,-0.711849268326108,-0.7110313683760338,0.2897879080485967,-0.7093914420929935,-0.7085694218736214,0.2922539656018371,-0.7069212828035687,0.2939048297411195,-0.7052676999652449,0.29556112484407426,-0.7036086990963163,-0.702777175083948,0.2980556935514996,0.29888990344819283,0.29972545121213784,0.30056233341717586,0.3014005466049811,0.3022400872850587,-0.6969190480652551,0.30392313699920875,0.3047666388914546,-0.6943885460076733,0.306457578650515,0.3073050091825624,0.30815374187287375,-0.6909962270262743,0.3098550987052789,-0.6892922847444093,0.3115616187806306,0.31241680540429595,-0.68672672878157,-0.6858689877171593,0.3149900246253226,0.31585030424167787,0.316711847095741,0.317574649119404,0.3184387062126432,-0.6806959857564521,-0.6798294309516495,-0.6789616335685422,-0.6780925978345157,-0.6772223280087128,-0.6763508283819979,-0.6754781032769185,0.32539584295233365,0.3262710059199641,-0.672852618791382,0.3280249643694239,-0.6710962490779592,0.32978373635470404,0.330664916124275,0.3315472856562918,0.33243084034502113,-0.6666844244464879,0.33420148661365157,0.3350885688262214,0.335976817460957,-0.663133772243393,0.33775679492099614,0.33864851413108754,0.33954138053304855,-0.6595646107576826,-0.6586694646563288,-0.6577731861087038,0.3431242199088588,0.3440227483895799,-0.6550776057036916,-0.6541768474384012,-0.6532749819122119,-0.6523720142529231,-0.6514679496183905,0.34943720680355794,-0.6496565502047942,0.35125077410903494,-0.6478408255321868,0.353068645564684,0.3539791820632574,0.35489077859770307,0.35580342977284446,0.3567171301642551,0.3576318743183562,-0.6414523432474843,0.35946447195514947,-0.6396176856141759,0.36130117847536053,-0.6377789413740599,-0.6368580507887877,-0.6359361554235967,0.3649867390384268,0.36591062688599646,0.3668355023797397,0.36776135975231333,-0.63131180679148,0.3696159969254279,-0.6294552349475095,-0.6285255082883314,-0.6275948290024466,-0.6266632030225073,-0.6257306363082837,-0.6247971348465351,-0.6238627046508796,-0.6229273517616637,0.3780089177541714,-0.6210539021967758,-0.6201158177342309,0.3808231649958939,-0.6182369601783607,0.3827038005451393,-0.6163545590572359,0.38458795476526336,0.38553133573791193,-0.6135244224393429,0.38742067390826623,-0.6116333815695225,-0.610686595247849,-0.609738973526578,0.3912094771698547,-0.6078412496074007,0.39310883966854854,-0.6059402614995028,-0.6049885596326977,0.3959639387240447,0.3969172270021929,-0.6021287013902323,0.3988261469315081,0.3997817653290392,-0.5992618528589586,-0.5983047143165794,0.4026531742494803,-0.5963881938899054,0.40457117451388364,0.4055312726873886,0.4064920938352505,0.40745363114038735,-0.5915841222358238,-0.5906211731533672,-0.5896575284934036,0.411306804841912,-0.5877281800703823,-0.58676249017387,0.4142038675674329,0.4151708861692672,-0.583861441372679,-0.5828931220825786,0.41807583699572853,-0.5809545712010705,-0.5799843537555659,0.4209864822305721,0.4219579296367912,-0.5770700186761438,0.42390263013405044,0.4248758688913764,0.4258496904017595,0.426824087453252,-0.5722009471837619,-0.5712254207563596,-0.5702493405288728,0.43072728621732226,0.43170445218401277,0.4326821500563614,0.43366037250311784,0.4346391121768321,-0.5643816382859322,-0.563401886264382,0.4375783608467207,-0.5614409043627233,-0.5604596893179333,-0.5594780014590288,0.4415041517591903,0.4424867628674646,0.4434698243822972,-0.555546671193823,0.445437268627802,-0.5535783636776958,-0.5525935756485244,0.4483916251639942,-0.5506227688043486,-0.5496367651304194,-0.5486503714035139,0.45233640477487264,-0.5466764442087234,0.4543110740204971,0.45529895182582847,-0.5437128184407068,-0.5427242444381247,0.4582646661637557,-0.5407460943154533,-0.539756533566472,0.4612333407098835,-0.5377764791970614,-0.5367860010076023,0.4642047675485836,0.46519581873267557,0.4661871447969501,-0.532821262014979,-0.5318294094679199,-0.5308373053348607,-0.5298449573967278,0.47114762655785686,-0.5278595612671807,0.4731334713248764,-0.5258732834762193,0.4751201665125645,0.4761138134677854,-0.5228923504402287,0.4781016669528663,0.4790958578056775,0.4800902142713211,0.4810847284976696,0.48207939262759936,-0.5169258012007617,-0.5159308608537863,-0.514935794202099,-0.5139406091203282,0.48705468651314343,0.48805008481642775,-0.5109544220956194,-0.5099588421111485,-0.5089631831210668,-0.5079674530187881,-0.506971659699982,-0.5059758110623251,0.49502008499475114,-0.5039839794296902,0.4970119877621601,-0.501992021332893,0.4990039853812034,-0.5],"p":[-2.0,-1.99601593625498,-1.9920318725099602,-1.9880478087649402,-1.9840637450199203,-1.9800796812749004,-1.9760956175298805,-1.9721115537848606,-1.9681274900398407,-1.9641434262948207,-1.9601593625498008,-1.956175298804781,-1.952191235059761,-1.948207171314741,-1.9442231075697212,-1.9402390438247012,-1.9362549800796813,-1.9322709163346614,-1.9282868525896415,-1.9243027888446216,-1.9203187250996017,-1.9163346613545817,-1.9123505976095618,-1.908366533864542,-1.904382470119522,-1.900398406374502,-1.8964143426294822,-1.8924302788844622,-1.8884462151394423,-1.8844621513944224,-1.8804780876494025,-1.8764940239043826,-1.8725099601593624,-1.8685258964143425,-1.8645418326693226,-1.8605577689243027,-1.8565737051792828,-1.8525896414342629,-1.848605577689243,-1.844621513944223,-1.840637450199203,-1.8366533864541832,-1.8326693227091633,-1.8286852589641434,-1.8247011952191234,-1.8207171314741035,-1.8167330677290836,-1.8127490039840637,-1.8087649402390438,-1.8047808764940239,-1.800796812749004,-1.796812749003984,-1.792828685258964,-1.7888446215139442,-1.7848605577689243,-1.7808764940239044,-1.7768924302788844,-1.7729083665338645,-1.7689243027888446,-1.7649402390438247,-1.7609561752988048,-1.7569721115537849,-1.752988047808765,-1.749003984063745,-1.745019920318725,-1.7410358565737052,-1.7370517928286853,-1.7330677290836654,-1.7290836653386454,-1.7250996015936255,-1.7211155378486056,-1.7171314741035857,-1.7131474103585658,-1.7091633466135459,-1.705179282868526,-1.701195219123506,-1.697211155378486,-1.6932270916334662,-1.6892430278884463,-1.6852589641434264,-1.6812749003984064,-1.6772908366533865,-1.6733067729083666,-1.6693227091633467,-1.6653386454183268,-1.6613545816733069,-1.657370517928287,-1.653386454183267,-1.649402390438247,-1.6454183266932272,-1.6414342629482073,-1.6374501992031874,-1.6334661354581674,-1.6294820717131475,-1.6254980079681276,-1.6215139442231075,-1.6175298804780875,-1.6135458167330676,-1.6095617529880477,-1.6055776892430278,-1.6015936254980079,-1.597609561752988,-1.593625498007968,-1.5896414342629481,-1.5856573705179282,-1.5816733067729083,-1.5776892430278884,-1.5737051792828685,-1.5697211155378485,-1.5657370517928286,-1.5617529880478087,-1.5577689243027888,-1.5537848605577689,-1.549800796812749,-1.545816733067729,-1.5418326693227091,-1.5378486055776892,-1.5338645418326693,-1.5298804780876494,-1.5258964143426295,-1.5219123505976095,-1.5179282868525896,-1.5139442231075697,-1.5099601593625498,-1.5059760956175299,-1.50199203187251,-1.49800796812749,-1.4940239043824701,-1.4900398406374502,-1.4860557768924303,-1.4820717131474104,-1.4780876494023905,-1.4741035856573705,-1.4701195219123506,-1.4661354581673307,-1.4621513944223108,-1.4581673306772909,-1.454183266932271,-1.450199203187251,-1.4462151394422311,-1.4422310756972112,-1.4382470119521913,-1.4342629482071714,-1.4302788844621515,-1.4262948207171315,-1.4223107569721116,-1.4183266932270917,-1.4143426294820718,-1.4103585657370519,-1.406374501992032,-1.402390438247012,-1.3984063745019921,-1.3944223107569722,-1.3904382470119523,-1.3864541832669324,-1.3824701195219125,-1.3784860557768925,-1.3745019920318724,-1.3705179282868525,-1.3665338645418326,-1.3625498007968126,-1.3585657370517927,-1.3545816733067728,-1.350597609561753,-1.346613545816733,-1.342629482071713,-1.3386454183266931,-1.3346613545816732,-1.3306772908366533,-1.3266932270916334,-1.3227091633466135,-1.3187250996015936,-1.3147410358565736,-1.3107569721115537,-1.3067729083665338,-1.302788844621514,-1.298804780876494,-1.294820717131474,-1.2908366533864541,-1.2868525896414342,-1.2828685258964143,-1.2788844621513944,-1.2749003984063745,-1.2709163346613546,-1.2669322709163346,-1.2629482071713147,-1.2589641434262948,-1.254980079681275,-1.250996015936255,-1.247011952191235,-1.2430278884462151,-1.2390438247011952,-1.2350597609561753,-1.2310756972111554,-1.2270916334661355,-1.2231075697211156,-1.2191235059760956,-1.2151394422310757,-1.2111553784860558,-1.207171314741036,-1.203187250996016,-1.199203187250996,-1.1952191235059761,-1.1912350597609562,-1.1872509960159363,-1.1832669322709164,-1.1792828685258965,-1.1752988047808766,-1.1713147410358566,-1.1673306772908367,-1.1633466135458168,-1.159362549800797,-1.155378486055777,-1.151394422310757,-1.1474103585657371,-1.1434262948207172,-1.1394422310756973,-1.1354581673306774,-1.1314741035856575,-1.1274900398406376,-1.1235059760956174,-1.1195219123505975,-1.1155378486055776,-1.1115537848605577,-1.1075697211155378,-1.1035856573705178,-1.099601593625498,-1.095617529880478,-1.091633466135458,-1.0876494023904382,-1.0836653386454183,-1.0796812749003983,-1.0756972111553784,-1.0717131474103585,-1.0677290836653386,-1.0637450199203187,-1.0597609561752988,-1.0557768924302788,-1.051792828685259,-1.047808764940239,-1.043824701195219,-1.0398406374501992,-1.0358565737051793,-1.0318725099601593,-1.0278884462151394,-1.0239043824701195,-1.0199203187250996,-1.0159362549800797,-1.0119521912350598,-1.0079681274900398,-1.00398406374502,-1.0,-0.9960159362549801,-0.9920318725099602,-0.9880478087649402,-0.9840637450199203,-0.9800796812749004,-0.9760956175298805,-0.9721115537848606,-0.9681274900398407,-0.9641434262948207,-0.9601593625498008,-0.9561752988047809,-0.952191235059761,-0.9482071713147411,-0.9442231075697212,-0.9402390438247012,-0.9362549800796812,-0.9322709163346613,-0.9282868525896414,-0.9243027888446215,-0.9203187250996016,-0.9163346613545816,-0.9123505976095617,-0.9083665338645418,-0.9043824701195219,-0.900398406374502,-0.896414342629482,-0.8924302788844621,-0.8884462151394422,-0.8844621513944223,-0.8804780876494024,-0.8764940239043825,-0.8725099601593626,-0.8685258964143426,-0.8645418326693227,-0.8605577689243028,-0.8565737051792829,-0.852589641434263,-0.848605577689243,-0.8446215139442231,-0.8406374501992032,-0.8366533864541833,-0.8326693227091634,-0.8286852589641435,-0.8247011952191236,-0.8207171314741036,-0.8167330677290837,-0.8127490039840638,-0.8087649402390438,-0.8047808764940239,-0.8007968127490039,-0.796812749003984,-0.7928286852589641,-0.7888446215139442,-0.7848605577689243,-0.7808764940239044,-0.7768924302788844,-0.7729083665338645,-0.7689243027888446,-0.7649402390438247,-0.7609561752988048,-0.7569721115537849,-0.7529880478087649,-0.749003984063745,-0.7450199203187251,-0.7410358565737052,-0.7370517928286853,-0.7330677290836654,-0.7290836653386454,-0.7250996015936255,-0.7211155378486056,-0.7171314741035857,-0.7131474103585658,-0.7091633466135459,-0.7051792828685259,-0.701195219123506,-0.6972111553784861,-0.6932270916334662,-0.6892430278884463,-0.6852589641434262,-0.6812749003984063,-0.6772908366533864,-0.6733067729083665,-0.6693227091633466,-0.6653386454183267,-0.6613545816733067,-0.6573705179282868,-0.6533864541832669,-0.649402390438247,-0.6454183266932271,-0.6414342629482072,-0.6374501992031872,-0.6334661354581673,-0.6294820717131474,-0.6254980079681275,-0.6215139442231076,-0.6175298804780877,-0.6135458167330677,-0.6095617529880478,-0.6055776892430279,-0.601593625498008,-0.5976095617529881,-0.5936254980079682,-0.5896414342629482,-0.5856573705179283,-0.5816733067729084,-0.5776892430278885,-0.5737051792828686,-0.5697211155378487,-0.5657370517928287,-0.5617529880478087,-0.5577689243027888,-0.5537848605577689,-0.549800796812749,-0.545816733067729,-0.5418326693227091,-0.5378486055776892,-0.5338645418326693,-0.5298804780876494,-0.5258964143426295,-0.5219123505976095,-0.5179282868525896,-0.5139442231075697,-0.5099601593625498,-0.5059760956175299,-0.50199203187251,-0.49800796812749004,-0.4940239043824701,-0.4900398406374502,-0.4860557768924303,-0.4820717131474104,-0.47808764940239046,-0.47410358565737054,-0.4701195219123506,-0.46613545816733065,-0.46215139442231074,-0.4581673306772908,-0.4541832669322709,-0.450199203187251,-0.44621513944223107,-0.44223107569721115,-0.43824701195219123,-0.4342629482071713,-0.4302788844621514,-0.4262948207171315,-0.42231075697211157,-0.41832669322709165,-0.41434262948207173,-0.4103585657370518,-0.4063745019920319,-0.40239043824701193,-0.398406374501992,-0.3944223107569721,-0.3904382470119522,-0.38645418326693226,-0.38247011952191234,-0.3784860557768924,-0.3745019920318725,-0.3705179282868526,-0.3665338645418327,-0.36254980079681276,-0.35856573705179284,-0.3545816733067729,-0.350597609561753,-0.3466135458167331,-0.3426294820717131,-0.3386454183266932,-0.3346613545816733,-0.33067729083665337,-0.32669322709163345,-0.32270916334661354,-0.3187250996015936,-0.3147410358565737,-0.3107569721115538,-0.30677290836653387,-0.30278884462151395,-0.29880478087649404,-0.2948207171314741,-0.2908366533864542,-0.2868525896414343,-0.28286852589641437,-0.2788844621513944,-0.2749003984063745,-0.27091633466135456,-0.26693227091633465,-0.26294820717131473,-0.2589641434262948,-0.2549800796812749,-0.250996015936255,-0.24701195219123506,-0.24302788844621515,-0.23904382470119523,-0.2350597609561753,-0.23107569721115537,-0.22709163346613545,-0.22310756972111553,-0.21912350597609562,-0.2151394422310757,-0.21115537848605578,-0.20717131474103587,-0.20318725099601595,-0.199203187250996,-0.1952191235059761,-0.19123505976095617,-0.18725099601593626,-0.18326693227091634,-0.17928286852589642,-0.1752988047808765,-0.17131474103585656,-0.16733067729083664,-0.16334661354581673,-0.1593625498007968,-0.1553784860557769,-0.15139442231075698,-0.14741035856573706,-0.14342629482071714,-0.1394422310756972,-0.13545816733067728,-0.13147410358565736,-0.12749003984063745,-0.12350597609561753,-0.11952191235059761,-0.11553784860557768,-0.11155378486055777,-0.10756972111553785,-0.10358565737051793,-0.099601593625498,-0.09561752988047809,-0.09163346613545817,-0.08764940239043825,-0.08366533864541832,-0.0796812749003984,-0.07569721115537849,-0.07171314741035857,-0.06772908366533864,-0.06374501992031872,-0.05976095617529881,-0.055776892430278883,-0.05179282868525897,-0.04780876494023904,-0.043824701195219126,-0.0398406374501992,-0.035856573705179286,-0.03187250996015936,-0.027888446215139442,-0.02390438247011952,-0.0199203187250996,-0.01593625498007968,-0.01195219123505976,-0.00796812749003984,-0.00398406374501992,0.0],"y":[-1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,1.0,-1.0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json b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/small_positive.json new file mode 100644 index 000000000000..407484b077e4 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/small_positive.json @@ -0,0 +1 @@ +{"expected":[-0.5,-0.4990039853812034,0.501992021332893,-0.4970119877621601,-0.49601602057030986,0.504979915005249,0.5059758110623251,0.506971659699982,-0.492032546981212,0.5089631831210668,0.5099588421111485,0.5109544220956194,0.5119499151835722,-0.48705468651314343,0.5139406091203282,0.514935794202099,-0.4840691391462137,0.5169258012007617,-0.48207939262759936,0.5189152715023305,-0.4800902142713211,-0.4790958578056775,-0.4781016669528663,0.5228923504402287,0.5238861865322146,0.5248798334874355,-0.47412671652378063,-0.4731334713248764,-0.47214043873281925,0.5288523734421431,-0.4701550426032722,0.5308373053348607,-0.46817059053208004,-0.46717873798502096,0.5338128552030499,0.5348041812673244,-0.4642047675485836,-0.46321399899239774,0.5377764791970614,0.5387666592901165,0.539756533566472,0.5407460943154533,-0.4582646661637557,0.5427242444381247,0.5437128184407068,-0.45529895182582847,-0.4543110740204971,-0.45332355579127664,0.5476635952251274,-0.45134962859648603,-0.4503632348695807,-0.44937723119565137,0.5516083748360058,-0.44740642435147565,-0.4464216363223043,0.554562731372198,0.555546671193823,0.5565301756177028,0.5575132371325354,-0.4415041517591903,0.5594780014590288,-0.43954031068206667,-0.4385590956372767,0.5624216391532794,-0.43659811373561797,-0.4356183617140678,-0.4346391121768321,0.5663396274968822,0.5673178499436387,0.5682955478159872,0.5692727137826776,0.5702493405288728,-0.42877457924364026,0.5722009471837619,0.5731759125467479,0.5741503095982404,0.5751241311086236,-0.42390263013405044,0.5770700186761438,-0.4219579296367912,-0.4209864822305721,-0.4200156462444341,-0.4190454287989295,-0.41807583699572853,-0.4171068779174214,-0.41613855862732096,0.5848291138307328,-0.4142038675674329,-0.41323750982612995,-0.41227181992961764,0.5886931951580879,0.5896575284934036,-0.4093788268466329,0.5915841222358238,-0.40745363114038735,-0.4064920938352505,-0.4055312726873886,0.5954288254861164,0.5963881938899054,-0.4026531742494803,-0.4016952856834206,-0.4007381471410414,-0.3997817653290392,0.6011738530684919,0.6021287013902323,0.6030827729978071,-0.3959639387240447,0.6049885596326977,0.6059402614995028,0.6068911603314515,-0.39215875039259923,-0.3912094771698547,-0.390261026473422,0.610686595247849,0.6116333815695225,0.6125793260917337,-0.3864755775606571,-0.38553133573791193,-0.38458795476526336,0.6163545590572359,-0.3827038005451393,0.6182369601783607,-0.3808231649958939,-0.3798841822657691,0.6210539021967758,-0.3780089177541714,-0.3770726482383363,-0.3761372953491204,-0.37520286515346496,0.6257306363082837,0.6266632030225073,-0.3724051709975534,0.6285255082883314,-0.37054476505249045,-0.3696159969254279,-0.3686881932085199,0.6322386402476867,-0.3668355023797397,-0.36591062688599646,-0.3649867390384268,0.6359361554235967,0.6368580507887877,0.6377789413740599,0.6386988215246394,0.6396176856141759,0.6405355280448505,-0.35854765675251565,0.6423681256816439,0.6432828698357448,0.6441965702271555,-0.35489077859770307,-0.3539791820632574,0.646931354435316,0.6478408255321868,-0.35125077410903494,-0.3503434497952059,0.6505627931964421,0.6514679496183905,0.6523720142529231,-0.3467250180877881,0.6541768474384012,0.6550776057036916,0.6559772516104202,0.6568757800911412,0.6577731861087038,0.6586694646563288,0.6595646107576826,0.6604586194669515,-0.33864851413108754,-0.33775679492099614,-0.3368662277566071,0.664023182539043,-0.3350885688262214,-0.33420148661365157,0.6666844244464879,-0.33243084034502113,-0.3315472856562918,-0.330664916124275,-0.32978373635470404,0.6710962490779592,-0.3280249643694239,0.672852618791382,0.673728994080036,0.6746041570476664,-0.3245218967230815,-0.3236491716180021,0.6772223280087128,0.6780925978345157,-0.3210383664314578,0.6798294309516495,0.6806959857564521,-0.3184387062126432,0.682425350880596,0.6832881529042589,-0.31585030424167787,0.6850099753746773,-0.31413101228284074,0.68672672878157,-0.31241680540429595,-0.3115616187806306,-0.31070771525559077,0.6901449012947211,-0.3090037729737258,-0.30815374187287375,0.6926949908174376,-0.306457578650515,0.6943885460076733,0.6952333611085455,0.6960768630007912,0.6969190480652551,-0.3022400872850587,0.6985994533950189,-0.30056233341717586,0.7002745487878622,-0.29888990344819283,0.7019443064485005,0.702777175083948,-0.2963913009036838,-0.29556112484407426,0.7052676999652449,-0.2939048297411195,-0.2930787171964313,-0.2922539656018371,-0.29143057812637857,-0.29060855790700657,-0.2897879080485967,0.7110313683760338,-0.28815073167389205,0.7126657887928697,-0.28651907320043773,-0.2857053205985929,-0.28489295631442063,-0.28408198322881667,0.7167275958092264,-0.2824642220174085,0.7183425605060082,0.7191479406260229,0.7199519156209673,0.7207544828009255,0.721555639507701,-0.27764461688521946,-0.2768462889727015,-0.2760493793180012,-0.2752538904528037,-0.2744598248772632,-0.27366718506004467,-0.2728759734383657,0.7279138075819592,-0.2712978443735256,-0.27051093164796375,0.7302745434467669,-0.2689414213699951,0.7318411716522565,-0.2673776797048556,0.7334020223713564,0.7341802757245924,-0.26504292177049016,-0.26426757220833075,0.7365063223474777,0.7372787598641314,0.7380497383395574,-0.26118074419764586,0.7395873103117309,-0.25964610004255406,-0.25888097714025554,-0.25811732283070565,0.7426448610671218,-0.2565944272354546,0.7441648105031097,-0.25507742744548256,0.7456788572205606,-0.25356633716694904,0.7471869877537496,0.7479388303742951,0.7486891891161309,0.7494380624304322,0.7501854487980312,-0.24906865327065797,-0.24832424523571567,-0.24758132852779374,-0.24683990454819357,-0.246099974668945,-0.24536154023288614,-0.24462460255374377,-0.2438891629162154,0.7568447774239493,-0.2424227827601356,-0.24169184466657548,-0.2409624094647805,-0.240234478295551,0.7604919477288361,-0.23878313247545968,-0.23805971996393083,0.76266218423619,0.7633825791258402,0.7641014637340369,0.7648188371177863,0.7655346983619923,0.766249046579363,-0.23303811908968142,0.7676732005228976,-0.2316169953873388,-0.23090870759739998,0.7697980631430364,0.7705033161115292,-0.22879294938722428,0.7719092659785148,0.7726099615674279,0.77330913676504,-0.2259932090163797,0.7747029236620817,-0.22460246573411943,-0.2239093777130859,0.7767821872434194,-0.22252777132012905,0.7781607461668766,-0.22115226069892516,0.7795332077050302,0.7802171510271283,0.7808995689414716,0.7815804611477725,0.7822598273712472,0.7829376673625102,-0.21638601910253422,0.7842887677772008,0.7849620278278768,-0.21436623909937913,0.7863039668714172,-0.21302735435900294,0.7876397971347294,0.7883054213025104,0.7889695181186522,-0.21036791241822717,-0.2097068702853163,-0.20904735543572148,0.7916106322014205,-0.20773290727917054,0.7929220262409701,0.7935754329039375,0.7942273128753433,-0.20512233365579666,0.7955264935228212,-0.2038262053533247,0.7968195699743029,0.7974638197871856,-0.20189345561036667,-0.20125225589133117,0.7993874192939115,-0.19997442968253867,0.8006621975737818,-0.19870269852041622,-0.19806911752629222,0.8025629410170072,-0.19680652240776936,0.8038224927039042,0.8044499868782136,0.8050759606628859,-0.19429958537292835,-0.19367665063877404,-0.19305523452300993,-0.19243533639292745,-0.19181695559486975,-0.19120009145435082,-0.19058474327617453,0.8100290896554456,0.8106414080767673,-0.18874778725560024,-0.18813849556481646,0.8124692839460713,-0.18692444790599258,-0.18631969028419174,0.8142835576680418,0.8148852968269077,0.8154855280881168,0.8160842523667706,0.816681470597242,-0.18272281626694686,0.8178713927467564,-0.18153590137018685,0.8190553023924736,0.8196450050636561,-0.17976679230917353,-0.17918008866012225,-0.17859488290499065,-0.17801117394139335,-0.1774289606488795,-0.17684824188905343,0.823730983494305,-0.17569128332488,0.8248849588448991,-0.17454028878738687,0.8260329750045758,0.8266047514643237,0.8271750418524951,0.8277438474467114,-0.17168883045854413,-0.17112299055204594,-0.170558631505946,-0.16999575197589364,-0.16943435060115522,-0.1688744260047337,0.8316840232065118,-0.16775900155825313,0.8327965011260423,-0.16664946729974456,-0.16609690537908955,0.8344541883600805,-0.1649961845947322,-0.1644480227407132,-0.16390132455985593,0.8366439114809212,-0.1628123130703437,-0.1622699966507738,-0.1617291376827712,0.8388102654258655,0.8393482142818239,0.8398847105061605,-0.15958024426581602,-0.15904664838466168,-0.15851450018691385,0.8420162020047927,-0.15745454011839094,0.8430732751483572,0.8435996495234136,-0.1558754152614064,0.8446480825390371,0.8451701446830923,-0.1543092270577976,0.8462099691007897,0.8467277349561422,-0.15275592768170068,-0.15224101699006198,-0.15172753113374038,-0.1512154682651237,-0.15070482652430178,-0.15019560403917917,-0.1496877989255875,0.8508185907126022,-0.1486764332166318,-0.14817286879357452,-0.1476707140868845,-0.14716996715370537,0.8533293739602237,0.8538273112204575,0.8543238466037347,-0.14518101790213192,0.8553127197016352,0.8558050614246694,-0.1437039907126497,-0.1432144346793041,-0.14272626843374572,0.8577605100759957,0.858245902912205,0.8587299121473745,-0.1407874601359028,0.8596937881549601,0.8601736591224378,0.8606521548787878,0.8611292775459434,0.8616050292554093,0.8620794121481574,-0.1374475716254784,-0.1369759199059062,0.8634943694756204,-0.1360367013031008,0.8644308699446756,0.8648970854145406,0.8653619473108288,0.8658254578465155,-0.13371238075688333,0.8667484337305863,-0.1327920964527835,-0.13233396906046288,-0.1318771818377845,0.868578267477957,-0.13096761884259428,0.8694851614790455,0.8699366107291023,0.8703867312014448,0.8708355251974877,-0.1287170049739055,-0.12827085699652013,-0.12782602854688602,-0.12738251729437394,-0.12694032090129126,0.8735005629770229,-0.1260598633078973,0.8743784026022612,-0.12518463692750392,0.8752510204743965,0.8756853771860498,-0.12388156440805247,-0.12344980191710496,0.8769806670559179,-0.12259015508582918,-0.12216226593315319,0.8782643369290859,-0.1213103440781145,0.8791136934720095,0.8795364520118998,0.8799579339795867,0.8803781418186003,-0.11920292202211755],"p":[0.0,0.00398406374501992,0.00796812749003984,0.01195219123505976,0.01593625498007968,0.0199203187250996,0.02390438247011952,0.027888446215139442,0.03187250996015936,0.035856573705179286,0.0398406374501992,0.043824701195219126,0.04780876494023904,0.05179282868525897,0.055776892430278883,0.05976095617529881,0.06374501992031872,0.06772908366533864,0.07171314741035857,0.07569721115537849,0.0796812749003984,0.08366533864541832,0.08764940239043825,0.09163346613545817,0.09561752988047809,0.099601593625498,0.10358565737051793,0.10756972111553785,0.11155378486055777,0.11553784860557768,0.11952191235059761,0.12350597609561753,0.12749003984063745,0.13147410358565736,0.13545816733067728,0.1394422310756972,0.14342629482071714,0.14741035856573706,0.15139442231075698,0.1553784860557769,0.1593625498007968,0.16334661354581673,0.16733067729083664,0.17131474103585656,0.1752988047808765,0.17928286852589642,0.18326693227091634,0.18725099601593626,0.19123505976095617,0.1952191235059761,0.199203187250996,0.20318725099601595,0.20717131474103587,0.21115537848605578,0.2151394422310757,0.21912350597609562,0.22310756972111553,0.22709163346613545,0.23107569721115537,0.2350597609561753,0.23904382470119523,0.24302788844621515,0.24701195219123506,0.250996015936255,0.2549800796812749,0.2589641434262948,0.26294820717131473,0.26693227091633465,0.27091633466135456,0.2749003984063745,0.2788844621513944,0.28286852589641437,0.2868525896414343,0.2908366533864542,0.2948207171314741,0.29880478087649404,0.30278884462151395,0.30677290836653387,0.3107569721115538,0.3147410358565737,0.3187250996015936,0.32270916334661354,0.32669322709163345,0.33067729083665337,0.3346613545816733,0.3386454183266932,0.3426294820717131,0.3466135458167331,0.350597609561753,0.3545816733067729,0.35856573705179284,0.36254980079681276,0.3665338645418327,0.3705179282868526,0.3745019920318725,0.3784860557768924,0.38247011952191234,0.38645418326693226,0.3904382470119522,0.3944223107569721,0.398406374501992,0.40239043824701193,0.4063745019920319,0.4103585657370518,0.41434262948207173,0.41832669322709165,0.42231075697211157,0.4262948207171315,0.4302788844621514,0.4342629482071713,0.43824701195219123,0.44223107569721115,0.44621513944223107,0.450199203187251,0.4541832669322709,0.4581673306772908,0.46215139442231074,0.46613545816733065,0.4701195219123506,0.47410358565737054,0.47808764940239046,0.4820717131474104,0.4860557768924303,0.4900398406374502,0.4940239043824701,0.49800796812749004,0.50199203187251,0.5059760956175299,0.5099601593625498,0.5139442231075697,0.5179282868525896,0.5219123505976095,0.5258964143426295,0.5298804780876494,0.5338645418326693,0.5378486055776892,0.5418326693227091,0.545816733067729,0.549800796812749,0.5537848605577689,0.5577689243027888,0.5617529880478087,0.5657370517928287,0.5697211155378487,0.5737051792828686,0.5776892430278885,0.5816733067729084,0.5856573705179283,0.5896414342629482,0.5936254980079682,0.5976095617529881,0.601593625498008,0.6055776892430279,0.6095617529880478,0.6135458167330677,0.6175298804780877,0.6215139442231076,0.6254980079681275,0.6294820717131474,0.6334661354581673,0.6374501992031872,0.6414342629482072,0.6454183266932271,0.649402390438247,0.6533864541832669,0.6573705179282868,0.6613545816733067,0.6653386454183267,0.6693227091633466,0.6733067729083665,0.6772908366533864,0.6812749003984063,0.6852589641434262,0.6892430278884463,0.6932270916334662,0.6972111553784861,0.701195219123506,0.7051792828685259,0.7091633466135459,0.7131474103585658,0.7171314741035857,0.7211155378486056,0.7250996015936255,0.7290836653386454,0.7330677290836654,0.7370517928286853,0.7410358565737052,0.7450199203187251,0.749003984063745,0.7529880478087649,0.7569721115537849,0.7609561752988048,0.7649402390438247,0.7689243027888446,0.7729083665338645,0.7768924302788844,0.7808764940239044,0.7848605577689243,0.7888446215139442,0.7928286852589641,0.796812749003984,0.8007968127490039,0.8047808764940239,0.8087649402390438,0.8127490039840638,0.8167330677290837,0.8207171314741036,0.8247011952191236,0.8286852589641435,0.8326693227091634,0.8366533864541833,0.8406374501992032,0.8446215139442231,0.848605577689243,0.852589641434263,0.8565737051792829,0.8605577689243028,0.8645418326693227,0.8685258964143426,0.8725099601593626,0.8764940239043825,0.8804780876494024,0.8844621513944223,0.8884462151394422,0.8924302788844621,0.896414342629482,0.900398406374502,0.9043824701195219,0.9083665338645418,0.9123505976095617,0.9163346613545816,0.9203187250996016,0.9243027888446215,0.9282868525896414,0.9322709163346613,0.9362549800796812,0.9402390438247012,0.9442231075697212,0.9482071713147411,0.952191235059761,0.9561752988047809,0.9601593625498008,0.9641434262948207,0.9681274900398407,0.9721115537848606,0.9760956175298805,0.9800796812749004,0.9840637450199203,0.9880478087649402,0.9920318725099602,0.9960159362549801,1.0,1.00398406374502,1.0079681274900398,1.0119521912350598,1.0159362549800797,1.0199203187250996,1.0239043824701195,1.0278884462151394,1.0318725099601593,1.0358565737051793,1.0398406374501992,1.043824701195219,1.047808764940239,1.051792828685259,1.0557768924302788,1.0597609561752988,1.0637450199203187,1.0677290836653386,1.0717131474103585,1.0756972111553784,1.0796812749003983,1.0836653386454183,1.0876494023904382,1.091633466135458,1.095617529880478,1.099601593625498,1.1035856573705178,1.1075697211155378,1.1115537848605577,1.1155378486055776,1.1195219123505975,1.1235059760956174,1.1274900398406376,1.1314741035856575,1.1354581673306774,1.1394422310756973,1.1434262948207172,1.1474103585657371,1.151394422310757,1.155378486055777,1.159362549800797,1.1633466135458168,1.1673306772908367,1.1713147410358566,1.1752988047808766,1.1792828685258965,1.1832669322709164,1.1872509960159363,1.1912350597609562,1.1952191235059761,1.199203187250996,1.203187250996016,1.207171314741036,1.2111553784860558,1.2151394422310757,1.2191235059760956,1.2231075697211156,1.2270916334661355,1.2310756972111554,1.2350597609561753,1.2390438247011952,1.2430278884462151,1.247011952191235,1.250996015936255,1.254980079681275,1.2589641434262948,1.2629482071713147,1.2669322709163346,1.2709163346613546,1.2749003984063745,1.2788844621513944,1.2828685258964143,1.2868525896414342,1.2908366533864541,1.294820717131474,1.298804780876494,1.302788844621514,1.3067729083665338,1.3107569721115537,1.3147410358565736,1.3187250996015936,1.3227091633466135,1.3266932270916334,1.3306772908366533,1.3346613545816732,1.3386454183266931,1.342629482071713,1.346613545816733,1.350597609561753,1.3545816733067728,1.3585657370517927,1.3625498007968126,1.3665338645418326,1.3705179282868525,1.3745019920318724,1.3784860557768925,1.3824701195219125,1.3864541832669324,1.3904382470119523,1.3944223107569722,1.3984063745019921,1.402390438247012,1.406374501992032,1.4103585657370519,1.4143426294820718,1.4183266932270917,1.4223107569721116,1.4262948207171315,1.4302788844621515,1.4342629482071714,1.4382470119521913,1.4422310756972112,1.4462151394422311,1.450199203187251,1.454183266932271,1.4581673306772909,1.4621513944223108,1.4661354581673307,1.4701195219123506,1.4741035856573705,1.4780876494023905,1.4820717131474104,1.4860557768924303,1.4900398406374502,1.4940239043824701,1.49800796812749,1.50199203187251,1.5059760956175299,1.5099601593625498,1.5139442231075697,1.5179282868525896,1.5219123505976095,1.5258964143426295,1.5298804780876494,1.5338645418326693,1.5378486055776892,1.5418326693227091,1.545816733067729,1.549800796812749,1.5537848605577689,1.5577689243027888,1.5617529880478087,1.5657370517928286,1.5697211155378485,1.5737051792828685,1.5776892430278884,1.5816733067729083,1.5856573705179282,1.5896414342629481,1.593625498007968,1.597609561752988,1.6015936254980079,1.6055776892430278,1.6095617529880477,1.6135458167330676,1.6175298804780875,1.6215139442231075,1.6254980079681276,1.6294820717131475,1.6334661354581674,1.6374501992031874,1.6414342629482073,1.6454183266932272,1.649402390438247,1.653386454183267,1.657370517928287,1.6613545816733069,1.6653386454183268,1.6693227091633467,1.6733067729083666,1.6772908366533865,1.6812749003984064,1.6852589641434264,1.6892430278884463,1.6932270916334662,1.697211155378486,1.701195219123506,1.705179282868526,1.7091633466135459,1.7131474103585658,1.7171314741035857,1.7211155378486056,1.7250996015936255,1.7290836653386454,1.7330677290836654,1.7370517928286853,1.7410358565737052,1.745019920318725,1.749003984063745,1.752988047808765,1.7569721115537849,1.7609561752988048,1.7649402390438247,1.7689243027888446,1.7729083665338645,1.7768924302788844,1.7808764940239044,1.7848605577689243,1.7888446215139442,1.792828685258964,1.796812749003984,1.800796812749004,1.8047808764940239,1.8087649402390438,1.8127490039840637,1.8167330677290836,1.8207171314741035,1.8247011952191234,1.8286852589641434,1.8326693227091633,1.8366533864541832,1.840637450199203,1.844621513944223,1.848605577689243,1.8525896414342629,1.8565737051792828,1.8605577689243027,1.8645418326693226,1.8685258964143425,1.8725099601593624,1.8764940239043826,1.8804780876494025,1.8844621513944224,1.8884462151394423,1.8924302788844622,1.8964143426294822,1.900398406374502,1.904382470119522,1.908366533864542,1.9123505976095618,1.9163346613545817,1.9203187250996017,1.9243027888446216,1.9282868525896415,1.9322709163346614,1.9362549800796813,1.9402390438247012,1.9442231075697212,1.948207171314741,1.952191235059761,1.956175298804781,1.9601593625498008,1.9641434262948207,1.9681274900398407,1.9721115537848606,1.9760956175298805,1.9800796812749004,1.9840637450199203,1.9880478087649402,1.9920318725099602,1.99601593625498,2.0],"y":[1.0,1.0,-1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,-1.0,1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,1.0,-1.0,-1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,1.0,1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0,1.0,-1.0,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.0,-1.0,-1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,1.0,1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,-1.0,1.0,1.0,-1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0]} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/tiny_negative.json b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/tiny_negative.json new file mode 100644 index 000000000000..d6973c8b7ffe --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/tiny_negative.json @@ -0,0 +1 @@ +{"expected":[0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,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5,0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5],"p":[-1.0e-20,-9.9800796812749e-21,-9.9601593625498e-21,-9.940239043824701e-21,-9.9203187250996e-21,-9.900398406374502e-21,-9.880478087649401e-21,-9.860557768924302e-21,-9.840637450199203e-21,-9.820717131474103e-21,-9.800796812749004e-21,-9.780876494023904e-21,-9.760956175298805e-21,-9.741035856573704e-21,-9.721115537848605e-21,-9.701195219123505e-21,-9.681274900398406e-21,-9.661354581673307e-21,-9.641434262948206e-21,-9.621513944223107e-21,-9.601593625498007e-21,-9.581673306772908e-21,-9.561752988047808e-21,-9.541832669322709e-21,-9.52191235059761e-21,-9.50199203187251e-21,-9.48207171314741e-21,-9.46215139442231e-21,-9.442231075697211e-21,-9.42231075697211e-21,-9.402390438247012e-21,-9.382470119521911e-21,-9.362549800796812e-21,-9.342629482071713e-21,-9.322709163346613e-21,-9.302788844621514e-21,-9.282868525896413e-21,-9.262948207171314e-21,-9.243027888446214e-21,-9.223107569721115e-21,-9.203187250996016e-21,-9.183266932270916e-21,-9.163346613545817e-21,-9.143426294820716e-21,-9.123505976095617e-21,-9.103585657370517e-21,-9.083665338645418e-21,-9.063745019920317e-21,-9.043824701195219e-21,-9.02390438247012e-21,-9.003984063745019e-21,-8.98406374501992e-21,-8.96414342629482e-21,-8.944223107569721e-21,-8.92430278884462e-21,-8.904382470119521e-21,-8.884462151394422e-21,-8.864541832669322e-21,-8.844621513944223e-21,-8.824701195219123e-21,-8.804780876494024e-21,-8.784860557768923e-21,-8.764940239043824e-21,-8.745019920318725e-21,-8.725099601593625e-21,-8.705179282868526e-21,-8.685258964143426e-21,-8.665338645418327e-21,-8.645418326693226e-21,-8.625498007968127e-21,-8.605577689243027e-21,-8.585657370517928e-21,-8.565737051792829e-21,-8.545816733067728e-21,-8.52589641434263e-21,-8.505976095617529e-21,-8.48605577689243e-21,-8.46613545816733e-21,-8.44621513944223e-21,-8.426294820717132e-21,-8.406374501992031e-21,-8.386454183266932e-21,-8.366533864541832e-21,-8.346613545816733e-21,-8.326693227091632e-21,-8.306772908366534e-21,-8.286852589641433e-21,-8.266932270916334e-21,-8.247011952191235e-21,-8.227091633466135e-21,-8.207171314741036e-21,-8.187250996015935e-21,-8.167330677290836e-21,-8.147410358565736e-21,-8.127490039840637e-21,-8.107569721115538e-21,-8.087649402390438e-21,-8.067729083665339e-21,-8.047808764940238e-21,-8.02788844621514e-21,-8.007968127490039e-21,-7.98804780876494e-21,-7.968127490039841e-21,-7.94820717131474e-21,-7.928286852589642e-21,-7.908366533864541e-21,-7.888446215139442e-21,-7.868525896414342e-21,-7.848605577689243e-21,-7.828685258964142e-21,-7.808764940239043e-21,-7.788844621513944e-21,-7.768924302788844e-21,-7.749003984063745e-21,-7.729083665338645e-21,-7.709163346613546e-21,-7.689243027888445e-21,-7.669322709163346e-21,-7.649402390438247e-21,-7.629482071713147e-21,-7.609561752988048e-21,-7.589641434262947e-21,-7.569721115537849e-21,-7.549800796812748e-21,-7.529880478087649e-21,-7.509960159362549e-21,-7.49003984063745e-21,-7.470119521912351e-21,-7.45019920318725e-21,-7.430278884462151e-21,-7.410358565737051e-21,-7.390438247011952e-21,-7.370517928286852e-21,-7.350597609561753e-21,-7.330677290836654e-21,-7.310756972111553e-21,-7.290836653386454e-21,-7.270916334661354e-21,-7.250996015936255e-21,-7.231075697211154e-21,-7.211155378486055e-21,-7.191235059760955e-21,-7.171314741035856e-21,-7.151394422310757e-21,-7.131474103585657e-21,-7.111553784860558e-21,-7.091633466135457e-21,-7.071713147410358e-21,-7.051792828685258e-21,-7.031872509960159e-21,-7.01195219123506e-21,-6.99203187250996e-21,-6.97211155378486e-21,-6.95219123505976e-21,-6.932270916334661e-21,-6.912350597609561e-21,-6.892430278884462e-21,-6.872509960159363e-21,-6.852589641434262e-21,-6.832669322709164e-21,-6.812749003984063e-21,-6.792828685258964e-21,-6.7729083665338644e-21,-6.752988047808765e-21,-6.733067729083665e-21,-6.713147410358565e-21,-6.693227091633466e-21,-6.673306772908366e-21,-6.653386454183266e-21,-6.633466135458167e-21,-6.6135458167330676e-21,-6.593625498007968e-21,-6.573705179282868e-21,-6.5537848605577685e-21,-6.533864541832669e-21,-6.513944223107569e-21,-6.4940239043824694e-21,-6.4741035856573705e-21,-6.454183266932271e-21,-6.434262948207171e-21,-6.4143426294820714e-21,-6.394422310756972e-21,-6.374501992031872e-21,-6.354581673306772e-21,-6.3346613545816726e-21,-6.314741035856574e-21,-6.294820717131474e-21,-6.274900398406374e-21,-6.2549800796812746e-21,-6.235059760956175e-21,-6.215139442231075e-21,-6.1952191235059755e-21,-6.175298804780876e-21,-6.155378486055777e-21,-6.135458167330677e-21,-6.1155378486055775e-21,-6.095617529880478e-21,-6.075697211155378e-21,-6.055776892430278e-21,-6.035856573705179e-21,-6.015936254980079e-21,-5.99601593625498e-21,-5.97609561752988e-21,-5.956175298804781e-21,-5.936254980079681e-21,-5.916334661354581e-21,-5.8964143426294816e-21,-5.876494023904382e-21,-5.856573705179283e-21,-5.836653386454183e-21,-5.8167330677290835e-21,-5.796812749003984e-21,-5.776892430278884e-21,-5.7569721115537844e-21,-5.737051792828685e-21,-5.717131474103585e-21,-5.697211155378486e-21,-5.6772908366533864e-21,-5.657370517928287e-21,-5.637450199203187e-21,-5.617529880478087e-21,-5.5976095617529876e-21,-5.577689243027888e-21,-5.557768924302788e-21,-5.537848605577689e-21,-5.5179282868525896e-21,-5.49800796812749e-21,-5.47808764940239e-21,-5.4581673306772905e-21,-5.438247011952191e-21,-5.418326693227091e-21,-5.3984063745019914e-21,-5.3784860557768925e-21,-5.358565737051793e-21,-5.338645418326693e-21,-5.318725099601593e-21,-5.298804780876494e-21,-5.278884462151394e-21,-5.258964143426294e-21,-5.2390438247011946e-21,-5.219123505976096e-21,-5.199203187250996e-21,-5.179282868525896e-21,-5.1593625498007965e-21,-5.139442231075697e-21,-5.119521912350597e-21,-5.0996015936254975e-21,-5.079681274900398e-21,-5.059760956175299e-21,-5.039840637450199e-21,-5.0199203187250994e-21,-5.0e-21,-4.9800796812749e-21,-4.9601593625498e-21,-4.940239043824701e-21,-4.920318725099602e-21,-4.900398406374502e-21,-4.880478087649402e-21,-4.8605577689243026e-21,-4.840637450199203e-21,-4.820717131474103e-21,-4.8007968127490035e-21,-4.780876494023904e-21,-4.760956175298805e-21,-4.741035856573705e-21,-4.7211155378486055e-21,-4.701195219123506e-21,-4.681274900398406e-21,-4.6613545816733064e-21,-4.641434262948207e-21,-4.621513944223107e-21,-4.601593625498008e-21,-4.581673306772908e-21,-4.561752988047809e-21,-4.541832669322709e-21,-4.521912350597609e-21,-4.5019920318725096e-21,-4.48207171314741e-21,-4.46215139442231e-21,-4.442231075697211e-21,-4.4223107569721115e-21,-4.402390438247012e-21,-4.382470119521912e-21,-4.3625498007968124e-21,-4.342629482071713e-21,-4.322709163346613e-21,-4.302788844621513e-21,-4.2828685258964144e-21,-4.262948207171315e-21,-4.243027888446215e-21,-4.223107569721115e-21,-4.203187250996016e-21,-4.183266932270916e-21,-4.163346613545816e-21,-4.1434262948207165e-21,-4.1235059760956176e-21,-4.103585657370518e-21,-4.083665338645418e-21,-4.0637450199203185e-21,-4.043824701195219e-21,-4.023904382470119e-21,-4.0039840637450194e-21,-3.9840637450199205e-21,-3.964143426294821e-21,-3.944223107569721e-21,-3.9243027888446214e-21,-3.904382470119522e-21,-3.884462151394422e-21,-3.864541832669322e-21,-3.8446215139442226e-21,-3.824701195219124e-21,-3.804780876494024e-21,-3.784860557768924e-21,-3.7649402390438246e-21,-3.745019920318725e-21,-3.725099601593625e-21,-3.7051792828685255e-21,-3.685258964143426e-21,-3.665338645418327e-21,-3.645418326693227e-21,-3.6254980079681274e-21,-3.605577689243028e-21,-3.585657370517928e-21,-3.565737051792828e-21,-3.545816733067729e-21,-3.525896414342629e-21,-3.50597609561753e-21,-3.48605577689243e-21,-3.466135458167331e-21,-3.446215139442231e-21,-3.426294820717131e-21,-3.4063745019920315e-21,-3.3864541832669322e-21,-3.3665338645418325e-21,-3.346613545816733e-21,-3.326693227091633e-21,-3.3067729083665338e-21,-3.286852589641434e-21,-3.2669322709163344e-21,-3.2470119521912347e-21,-3.2270916334661354e-21,-3.2071713147410357e-21,-3.187250996015936e-21,-3.1673306772908363e-21,-3.147410358565737e-21,-3.1274900398406373e-21,-3.1075697211155376e-21,-3.087649402390438e-21,-3.0677290836653386e-21,-3.047808764940239e-21,-3.027888446215139e-21,-3.0079681274900395e-21,-2.98804780876494e-21,-2.9681274900398405e-21,-2.9482071713147408e-21,-2.9282868525896415e-21,-2.9083665338645418e-21,-2.888446215139442e-21,-2.8685258964143424e-21,-2.848605577689243e-21,-2.8286852589641433e-21,-2.8087649402390437e-21,-2.788844621513944e-21,-2.7689243027888446e-21,-2.749003984063745e-21,-2.7290836653386452e-21,-2.7091633466135455e-21,-2.6892430278884462e-21,-2.6693227091633465e-21,-2.649402390438247e-21,-2.629482071713147e-21,-2.609561752988048e-21,-2.589641434262948e-21,-2.5697211155378484e-21,-2.5498007968127487e-21,-2.5298804780876494e-21,-2.5099601593625497e-21,-2.49003984063745e-21,-2.4701195219123503e-21,-2.450199203187251e-21,-2.4302788844621513e-21,-2.4103585657370516e-21,-2.390438247011952e-21,-2.3705179282868526e-21,-2.350597609561753e-21,-2.3306772908366532e-21,-2.3107569721115535e-21,-2.290836653386454e-21,-2.2709163346613545e-21,-2.2509960159362548e-21,-2.231075697211155e-21,-2.2111553784860558e-21,-2.191235059760956e-21,-2.1713147410358564e-21,-2.1513944223107567e-21,-2.1314741035856574e-21,-2.1115537848605577e-21,-2.091633466135458e-21,-2.0717131474103583e-21,-2.051792828685259e-21,-2.0318725099601593e-21,-2.0119521912350596e-21,-1.9920318725099602e-21,-1.9721115537848605e-21,-1.952191235059761e-21,-1.932270916334661e-21,-1.912350597609562e-21,-1.892430278884462e-21,-1.8725099601593624e-21,-1.8525896414342627e-21,-1.8326693227091634e-21,-1.8127490039840637e-21,-1.792828685258964e-21,-1.7729083665338643e-21,-1.752988047808765e-21,-1.7330677290836653e-21,-1.7131474103585656e-21,-1.6932270916334661e-21,-1.6733067729083664e-21,-1.6533864541832669e-21,-1.6334661354581672e-21,-1.6135458167330677e-21,-1.593625498007968e-21,-1.5737051792828685e-21,-1.5537848605577688e-21,-1.5338645418326693e-21,-1.5139442231075696e-21,-1.49402390438247e-21,-1.4741035856573704e-21,-1.4541832669322709e-21,-1.4342629482071712e-21,-1.4143426294820717e-21,-1.394422310756972e-21,-1.3745019920318725e-21,-1.3545816733067728e-21,-1.3346613545816733e-21,-1.3147410358565736e-21,-1.294820717131474e-21,-1.2749003984063744e-21,-1.2549800796812749e-21,-1.2350597609561752e-21,-1.2151394422310757e-21,-1.195219123505976e-21,-1.1752988047808764e-21,-1.1553784860557767e-21,-1.1354581673306772e-21,-1.1155378486055775e-21,-1.095617529880478e-21,-1.0756972111553783e-21,-1.0557768924302788e-21,-1.0358565737051791e-21,-1.0159362549800796e-21,-9.960159362549801e-22,-9.760956175298804e-22,-9.56175298804781e-22,-9.362549800796812e-22,-9.163346613545817e-22,-8.96414342629482e-22,-8.764940239043825e-22,-8.565737051792828e-22,-8.366533864541832e-22,-8.167330677290836e-22,-7.96812749003984e-22,-7.768924302788844e-22,-7.569721115537848e-22,-7.370517928286852e-22,-7.171314741035856e-22,-6.97211155378486e-22,-6.772908366533864e-22,-6.573705179282868e-22,-6.374501992031872e-22,-6.175298804780876e-22,-5.97609561752988e-22,-5.776892430278884e-22,-5.577689243027888e-22,-5.378486055776892e-22,-5.179282868525896e-22,-4.980079681274901e-22,-4.780876494023905e-22,-4.581673306772909e-22,-4.3824701195219125e-22,-4.183266932270916e-22,-3.98406374501992e-22,-3.784860557768924e-22,-3.585657370517928e-22,-3.386454183266932e-22,-3.187250996015936e-22,-2.98804780876494e-22,-2.788844621513944e-22,-2.589641434262948e-22,-2.3904382470119523e-22,-2.1912350597609563e-22,-1.99203187250996e-22,-1.792828685258964e-22,-1.593625498007968e-22,-1.394422310756972e-22,-1.1952191235059761e-22,-9.9601593625498e-23,-7.96812749003984e-23,-5.976095617529881e-23,-3.98406374501992e-23,-1.99203187250996e-23,0.0],"y":[-1.0,1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,1.0,-1.0,1.0,1.0,1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,-1.0,-1.0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loss/float64/log-gradient/test/fixtures/julia/tiny_positive.json b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/tiny_positive.json new file mode 100644 index 000000000000..e2f01c67063f --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/fixtures/julia/tiny_positive.json @@ -0,0 +1 @@ +{"expected":[0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0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.5,0.5,-0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5],"p":[0.0,1.99203187250996e-23,3.98406374501992e-23,5.976095617529881e-23,7.96812749003984e-23,9.9601593625498e-23,1.1952191235059761e-22,1.394422310756972e-22,1.593625498007968e-22,1.792828685258964e-22,1.99203187250996e-22,2.1912350597609563e-22,2.3904382470119523e-22,2.589641434262948e-22,2.788844621513944e-22,2.98804780876494e-22,3.187250996015936e-22,3.386454183266932e-22,3.585657370517928e-22,3.784860557768924e-22,3.98406374501992e-22,4.183266932270916e-22,4.3824701195219125e-22,4.581673306772909e-22,4.780876494023905e-22,4.980079681274901e-22,5.179282868525896e-22,5.378486055776892e-22,5.577689243027888e-22,5.776892430278884e-22,5.97609561752988e-22,6.175298804780876e-22,6.374501992031872e-22,6.573705179282868e-22,6.772908366533864e-22,6.97211155378486e-22,7.171314741035856e-22,7.370517928286852e-22,7.569721115537848e-22,7.768924302788844e-22,7.96812749003984e-22,8.167330677290836e-22,8.366533864541832e-22,8.565737051792828e-22,8.764940239043825e-22,8.96414342629482e-22,9.163346613545817e-22,9.362549800796812e-22,9.56175298804781e-22,9.760956175298804e-22,9.960159362549801e-22,1.0159362549800796e-21,1.0358565737051791e-21,1.0557768924302788e-21,1.0756972111553783e-21,1.095617529880478e-21,1.1155378486055775e-21,1.1354581673306772e-21,1.1553784860557767e-21,1.1752988047808764e-21,1.195219123505976e-21,1.2151394422310757e-21,1.2350597609561752e-21,1.2549800796812749e-21,1.2749003984063744e-21,1.294820717131474e-21,1.3147410358565736e-21,1.3346613545816733e-21,1.3545816733067728e-21,1.3745019920318725e-21,1.394422310756972e-21,1.4143426294820717e-21,1.4342629482071712e-21,1.4541832669322709e-21,1.4741035856573704e-21,1.49402390438247e-21,1.5139442231075696e-21,1.5338645418326693e-21,1.5537848605577688e-21,1.5737051792828685e-21,1.593625498007968e-21,1.6135458167330677e-21,1.6334661354581672e-21,1.6533864541832669e-21,1.6733067729083664e-21,1.6932270916334661e-21,1.7131474103585656e-21,1.7330677290836653e-21,1.752988047808765e-21,1.7729083665338643e-21,1.792828685258964e-21,1.8127490039840637e-21,1.8326693227091634e-21,1.8525896414342627e-21,1.8725099601593624e-21,1.892430278884462e-21,1.912350597609562e-21,1.932270916334661e-21,1.952191235059761e-21,1.9721115537848605e-21,1.9920318725099602e-21,2.0119521912350596e-21,2.0318725099601593e-21,2.051792828685259e-21,2.0717131474103583e-21,2.091633466135458e-21,2.1115537848605577e-21,2.1314741035856574e-21,2.1513944223107567e-21,2.1713147410358564e-21,2.191235059760956e-21,2.2111553784860558e-21,2.231075697211155e-21,2.2509960159362548e-21,2.2709163346613545e-21,2.290836653386454e-21,2.3107569721115535e-21,2.3306772908366532e-21,2.350597609561753e-21,2.3705179282868526e-21,2.390438247011952e-21,2.4103585657370516e-21,2.4302788844621513e-21,2.450199203187251e-21,2.4701195219123503e-21,2.49003984063745e-21,2.5099601593625497e-21,2.5298804780876494e-21,2.5498007968127487e-21,2.5697211155378484e-21,2.589641434262948e-21,2.609561752988048e-21,2.629482071713147e-21,2.649402390438247e-21,2.6693227091633465e-21,2.6892430278884462e-21,2.7091633466135455e-21,2.7290836653386452e-21,2.749003984063745e-21,2.7689243027888446e-21,2.788844621513944e-21,2.8087649402390437e-21,2.8286852589641433e-21,2.848605577689243e-21,2.8685258964143424e-21,2.888446215139442e-21,2.9083665338645418e-21,2.9282868525896415e-21,2.9482071713147408e-21,2.9681274900398405e-21,2.98804780876494e-21,3.0079681274900395e-21,3.027888446215139e-21,3.047808764940239e-21,3.0677290836653386e-21,3.087649402390438e-21,3.1075697211155376e-21,3.1274900398406373e-21,3.147410358565737e-21,3.1673306772908363e-21,3.187250996015936e-21,3.2071713147410357e-21,3.2270916334661354e-21,3.2470119521912347e-21,3.2669322709163344e-21,3.286852589641434e-21,3.3067729083665338e-21,3.326693227091633e-21,3.346613545816733e-21,3.3665338645418325e-21,3.3864541832669322e-21,3.4063745019920315e-21,3.426294820717131e-21,3.446215139442231e-21,3.466135458167331e-21,3.48605577689243e-21,3.50597609561753e-21,3.525896414342629e-21,3.545816733067729e-21,3.565737051792828e-21,3.585657370517928e-21,3.605577689243028e-21,3.6254980079681274e-21,3.645418326693227e-21,3.665338645418327e-21,3.685258964143426e-21,3.7051792828685255e-21,3.725099601593625e-21,3.745019920318725e-21,3.7649402390438246e-21,3.784860557768924e-21,3.804780876494024e-21,3.824701195219124e-21,3.8446215139442226e-21,3.864541832669322e-21,3.884462151394422e-21,3.904382470119522e-21,3.9243027888446214e-21,3.944223107569721e-21,3.964143426294821e-21,3.9840637450199205e-21,4.0039840637450194e-21,4.023904382470119e-21,4.043824701195219e-21,4.0637450199203185e-21,4.083665338645418e-21,4.103585657370518e-21,4.1235059760956176e-21,4.1434262948207165e-21,4.163346613545816e-21,4.183266932270916e-21,4.203187250996016e-21,4.223107569721115e-21,4.243027888446215e-21,4.262948207171315e-21,4.2828685258964144e-21,4.302788844621513e-21,4.322709163346613e-21,4.342629482071713e-21,4.3625498007968124e-21,4.382470119521912e-21,4.402390438247012e-21,4.4223107569721115e-21,4.442231075697211e-21,4.46215139442231e-21,4.48207171314741e-21,4.5019920318725096e-21,4.521912350597609e-21,4.541832669322709e-21,4.561752988047809e-21,4.581673306772908e-21,4.601593625498008e-21,4.621513944223107e-21,4.641434262948207e-21,4.6613545816733064e-21,4.681274900398406e-21,4.701195219123506e-21,4.7211155378486055e-21,4.741035856573705e-21,4.760956175298805e-21,4.780876494023904e-21,4.8007968127490035e-21,4.820717131474103e-21,4.840637450199203e-21,4.8605577689243026e-21,4.880478087649402e-21,4.900398406374502e-21,4.920318725099602e-21,4.940239043824701e-21,4.9601593625498e-21,4.9800796812749e-21,5.0e-21,5.0199203187250994e-21,5.039840637450199e-21,5.059760956175299e-21,5.079681274900398e-21,5.0996015936254975e-21,5.119521912350597e-21,5.139442231075697e-21,5.1593625498007965e-21,5.179282868525896e-21,5.199203187250996e-21,5.219123505976096e-21,5.2390438247011946e-21,5.258964143426294e-21,5.278884462151394e-21,5.298804780876494e-21,5.318725099601593e-21,5.338645418326693e-21,5.358565737051793e-21,5.3784860557768925e-21,5.3984063745019914e-21,5.418326693227091e-21,5.438247011952191e-21,5.4581673306772905e-21,5.47808764940239e-21,5.49800796812749e-21,5.5179282868525896e-21,5.537848605577689e-21,5.557768924302788e-21,5.577689243027888e-21,5.5976095617529876e-21,5.617529880478087e-21,5.637450199203187e-21,5.657370517928287e-21,5.6772908366533864e-21,5.697211155378486e-21,5.717131474103585e-21,5.737051792828685e-21,5.7569721115537844e-21,5.776892430278884e-21,5.796812749003984e-21,5.8167330677290835e-21,5.836653386454183e-21,5.856573705179283e-21,5.876494023904382e-21,5.8964143426294816e-21,5.916334661354581e-21,5.936254980079681e-21,5.956175298804781e-21,5.97609561752988e-21,5.99601593625498e-21,6.015936254980079e-21,6.035856573705179e-21,6.055776892430278e-21,6.075697211155378e-21,6.095617529880478e-21,6.1155378486055775e-21,6.135458167330677e-21,6.155378486055777e-21,6.175298804780876e-21,6.1952191235059755e-21,6.215139442231075e-21,6.235059760956175e-21,6.2549800796812746e-21,6.274900398406374e-21,6.294820717131474e-21,6.314741035856574e-21,6.3346613545816726e-21,6.354581673306772e-21,6.374501992031872e-21,6.394422310756972e-21,6.4143426294820714e-21,6.434262948207171e-21,6.454183266932271e-21,6.4741035856573705e-21,6.4940239043824694e-21,6.513944223107569e-21,6.533864541832669e-21,6.5537848605577685e-21,6.573705179282868e-21,6.593625498007968e-21,6.6135458167330676e-21,6.633466135458167e-21,6.653386454183266e-21,6.673306772908366e-21,6.693227091633466e-21,6.713147410358565e-21,6.733067729083665e-21,6.752988047808765e-21,6.7729083665338644e-21,6.792828685258964e-21,6.812749003984063e-21,6.832669322709164e-21,6.852589641434262e-21,6.872509960159363e-21,6.892430278884462e-21,6.912350597609561e-21,6.932270916334661e-21,6.95219123505976e-21,6.97211155378486e-21,6.99203187250996e-21,7.01195219123506e-21,7.031872509960159e-21,7.051792828685258e-21,7.071713147410358e-21,7.091633466135457e-21,7.111553784860558e-21,7.131474103585657e-21,7.151394422310757e-21,7.171314741035856e-21,7.191235059760955e-21,7.211155378486055e-21,7.231075697211154e-21,7.250996015936255e-21,7.270916334661354e-21,7.290836653386454e-21,7.310756972111553e-21,7.330677290836654e-21,7.350597609561753e-21,7.370517928286852e-21,7.390438247011952e-21,7.410358565737051e-21,7.430278884462151e-21,7.45019920318725e-21,7.470119521912351e-21,7.49003984063745e-21,7.509960159362549e-21,7.529880478087649e-21,7.549800796812748e-21,7.569721115537849e-21,7.589641434262947e-21,7.609561752988048e-21,7.629482071713147e-21,7.649402390438247e-21,7.669322709163346e-21,7.689243027888445e-21,7.709163346613546e-21,7.729083665338645e-21,7.749003984063745e-21,7.768924302788844e-21,7.788844621513944e-21,7.808764940239043e-21,7.828685258964142e-21,7.848605577689243e-21,7.868525896414342e-21,7.888446215139442e-21,7.908366533864541e-21,7.928286852589642e-21,7.94820717131474e-21,7.968127490039841e-21,7.98804780876494e-21,8.007968127490039e-21,8.02788844621514e-21,8.047808764940238e-21,8.067729083665339e-21,8.087649402390438e-21,8.107569721115538e-21,8.127490039840637e-21,8.147410358565736e-21,8.167330677290836e-21,8.187250996015935e-21,8.207171314741036e-21,8.227091633466135e-21,8.247011952191235e-21,8.266932270916334e-21,8.286852589641433e-21,8.306772908366534e-21,8.326693227091632e-21,8.346613545816733e-21,8.366533864541832e-21,8.386454183266932e-21,8.406374501992031e-21,8.426294820717132e-21,8.44621513944223e-21,8.46613545816733e-21,8.48605577689243e-21,8.505976095617529e-21,8.52589641434263e-21,8.545816733067728e-21,8.565737051792829e-21,8.585657370517928e-21,8.605577689243027e-21,8.625498007968127e-21,8.645418326693226e-21,8.665338645418327e-21,8.685258964143426e-21,8.705179282868526e-21,8.725099601593625e-21,8.745019920318725e-21,8.764940239043824e-21,8.784860557768923e-21,8.804780876494024e-21,8.824701195219123e-21,8.844621513944223e-21,8.864541832669322e-21,8.884462151394422e-21,8.904382470119521e-21,8.92430278884462e-21,8.944223107569721e-21,8.96414342629482e-21,8.98406374501992e-21,9.003984063745019e-21,9.02390438247012e-21,9.043824701195219e-21,9.063745019920317e-21,9.083665338645418e-21,9.103585657370517e-21,9.123505976095617e-21,9.143426294820716e-21,9.163346613545817e-21,9.183266932270916e-21,9.203187250996016e-21,9.223107569721115e-21,9.243027888446214e-21,9.262948207171314e-21,9.282868525896413e-21,9.302788844621514e-21,9.322709163346613e-21,9.342629482071713e-21,9.362549800796812e-21,9.382470119521911e-21,9.402390438247012e-21,9.42231075697211e-21,9.442231075697211e-21,9.46215139442231e-21,9.48207171314741e-21,9.50199203187251e-21,9.52191235059761e-21,9.541832669322709e-21,9.561752988047808e-21,9.581673306772908e-21,9.601593625498007e-21,9.621513944223107e-21,9.641434262948206e-21,9.661354581673307e-21,9.681274900398406e-21,9.701195219123505e-21,9.721115537848605e-21,9.741035856573704e-21,9.760956175298805e-21,9.780876494023904e-21,9.800796812749004e-21,9.820717131474103e-21,9.840637450199203e-21,9.860557768924302e-21,9.880478087649401e-21,9.900398406374502e-21,9.9203187250996e-21,9.940239043824701e-21,9.9601593625498e-21,9.9800796812749e-21,1.0e-20],"y":[-1.0,-1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0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-1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0,1.0,1.0,1.0]} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/test.js b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/test.js new file mode 100644 index 000000000000..a601ab2023b6 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/test.js @@ -0,0 +1,133 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var isAlmostSameValue = require( '@stdlib/number/float64/base/assert/is-almost-same-value' ); +var logGradient = require( './../lib' ); + + +// FIXTURES // + +var tinyPositive = require( './fixtures/julia/tiny_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); +var tinyNegative = require( './fixtures/julia/tiny_negative.json' ); +var smallNegative = require( './fixtures/julia/small_negative.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logGradient, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function computes the log loss gradient for tiny positive values', function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = tinyPositive.y; + p = tinyPositive.p; + expected = tinyPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the log loss gradient for small positive values', function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = smallPositive.y; + p = smallPositive.p; + expected = smallPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the log loss gradient for tiny negative values', function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = tinyNegative.y; + p = tinyNegative.p; + expected = tinyNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the log loss gradient for small negative values', function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = smallNegative.y; + p = smallNegative.p; + expected = smallNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { + var v; + + v = logGradient( NaN, 0.782 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + v = logGradient( 1.0, NaN ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `NaN` if y is not +1 or -1', function test( t ) { + var v; + + v = logGradient( -0.9, 1.0 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + v = logGradient( 0.453, 0.76 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/test.native.js b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/test.native.js new file mode 100644 index 000000000000..92fa2fd22beb --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float64/log-gradient/test/test.native.js @@ -0,0 +1,142 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var isAlmostSameValue = require( '@stdlib/number/float64/base/assert/is-almost-same-value' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var tinyPositive = require( './fixtures/julia/tiny_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); +var tinyNegative = require( './fixtures/julia/tiny_negative.json' ); +var smallNegative = require( './fixtures/julia/small_negative.json' ); + + +// VARIABLES // + +var logGradient = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( logGradient instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logGradient, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function computes the log loss gradient for tiny positive values', opts, function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = tinyPositive.y; + p = tinyPositive.p; + expected = tinyPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the log loss gradient for small positive values', opts, function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = smallPositive.y; + p = smallPositive.p; + expected = smallPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the log loss gradient for tiny negative values', opts, function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = tinyNegative.y; + p = tinyNegative.p; + expected = tinyNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the log loss gradient for small negative values', opts, function test( t ) { + var expected; + var y; + var p; + var v; + var i; + + y = smallNegative.y; + p = smallNegative.p; + expected = smallNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = logGradient( y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { + var v; + + v = logGradient( NaN, 0.782 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + v = logGradient( 1.0, NaN ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `NaN` if y is not +1 or -1', opts, function test( t ) { + var v; + + v = logGradient( -0.9, 1.0 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + v = logGradient( 0.453, 0.76 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.end(); +});