input shape (ML)

On the first layer of a network, you need to define the inputShape. The inputShape is [1] when there is 1 number as the input.

Python Example

For this data:

X:-101234
Y:-21471013

The input shape is [1]. I don’t really understand why.

JavaScript Example

// this might be incorrect…
const inputs = [ [1, 2], [3, 4], [5, 6], [7, 8]];
 
const inputTensor = tf.tensor2d(inputs, [4, 2]);
 

But shouldn’t the input shape of the Python example then be [6, 1]?