xy-scale 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-scale",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "main": "./index.js",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/datasets.js CHANGED
@@ -8,7 +8,8 @@ export const parseTrainingXY = ({
8
8
  yCallbackFunc,
9
9
  xCallbackFunc,
10
10
  groups,
11
- shuffle = false
11
+ shuffle = false,
12
+ minmaxRange
12
13
  }) => {
13
14
  let X = [];
14
15
  let Y = [];
@@ -36,13 +37,13 @@ export const parseTrainingXY = ({
36
37
  scaledConfig: configX,
37
38
  scaledKeyNames: keyNamesX
38
39
 
39
- } = scaleArrayObj({arrObj: X, repeat, groups})
40
+ } = scaleArrayObj({arrObj: X, repeat, groups, minmaxRange})
40
41
 
41
42
  const {
42
43
  scaledOutput: scaledY,
43
44
  scaledConfig: configY,
44
45
  scaledKeyNames: keyNamesY
45
- } = scaleArrayObj({arrObj: Y, repeat, groups})
46
+ } = scaleArrayObj({arrObj: Y, repeat, groups, minmaxRange})
46
47
 
47
48
  const splitIndex = Math.floor(scaledX.length * trainingSplit)
48
49
 
@@ -66,7 +67,8 @@ export const parseProductionX = ({
66
67
  repeat = {},
67
68
  xCallbackFunc,
68
69
  groups,
69
- shuffle = false
70
+ shuffle = false,
71
+ minmaxRange
70
72
  }) => {
71
73
  let X = [];
72
74
 
@@ -89,7 +91,7 @@ export const parseProductionX = ({
89
91
  scaledConfig: configX,
90
92
  scaledKeyNames: keyNamesX
91
93
 
92
- } = scaleArrayObj({arrObj: X, repeat, groups})
94
+ } = scaleArrayObj({arrObj: X, repeat, groups, minmaxRange})
93
95
 
94
96
 
95
97
  // Split into training and testing sets
package/test/test.js CHANGED
@@ -61,7 +61,8 @@ const test = async () => {
61
61
  shuffle: true,
62
62
  repeat: {
63
63
  close: 20
64
- }
64
+ },
65
+ minmaxRange: [-1, 1]
65
66
  });
66
67
 
67
68
 
@@ -80,6 +81,7 @@ const test = async () => {
80
81
  const inputX = tf.tensor3d(timeSteppedTrainX, [timeSteppedTrainX.length, timeSteps, colsX])
81
82
  const targetY = tf.tensor2d(trimedTrainY, [trimedTrainY.length, colsY])
82
83
 
84
+ console.log('trainX', trainX[trainX.length - 1])
83
85
  console.log('configX', keyNamesX)
84
86
  console.log('inputX', inputX)
85
87
  console.log('inputX', targetY)