.NET based ecosystem of open-source software for mathematics, science, and engineering.
henon on master
v1.30 (compare)
henon on master
Allow reinit of the np.self pro… (compare)
for example
input
using NumSharp;
var m = np.array(new double[]{1,2,3,4,5}).reshape(5,1);
m.ToString().Display();
var n = np.array(new double[,]{{1},{2},{3},{4},{5}});
n.ToString().Display();
output
[[1],
[2],
[3],
[4],
[5]]
[[1],
[2],
[3],
[4],
[5]]
Hi, i am trying to translate this model to sci-sharp:
model = Sequential()
model.add(Dense(512, input_shape=(1000,), activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(512, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(num_classes))
model.add(Activation('softmax'))
Anyone can help me to find how to add the last activation layer? Cannot find it under keras.layers.
Hey, I got through it! There seems to be an issue, however with the data I'm digging through. I was able to install an cli app that converts .nc files to JSON. Looking at the JSON dump, I see that the scale_factor and add_offset variables are listed as floats, but the number is too long for C# to parse without truncating:
{
"name": "scale_factor",
"shape": {
"class": "H5S_SIMPLE",
"dims": [
1
]
},
"type": {
"base": "H5T_IEEE_F32LE",
"class": "H5T_FLOAT"
},
"value": [
0.054936669766902924
]
},
Here's what it looks like from Microsoft.Research.Science.Data object:ds["y"].Metadata["scale_factor"] = 0.05493667
So, I'm wondering what my options are. I hate to just rely on the JSON dump because it makes the original file at 500k to a 500 meg json file
ncdump -h <filename>
is showing the shorter value. Is it possible that the json dump added extra numbers?? I think it was written in C: var tensors = model.predict(tensor,batch_size);
var tensor = tf.image.resize_images_v2(tf.image.decode_image(tf.io.read_file(test),3,TF_DataType.TF_FLOAT), img_dim)/255;
var tensors = model.predict(tensor,batch_size); // InvalidArgumentError : input must be 4-dimensional