RNN Keras in KNIME (Sequence to vector)

That’s because Keras is a Python package and the node uses Python under the hood.
For the setup please see https://docs.knime.com/2019-12/deep_learning_installation_guide/index.html.

1 Like

Hi Adrian,

Apologies for leaving this for a while, but I had to learn several other things before I could continue.

It took me a while to go forward, but I did so in the end. I upload my workflow to my public hub. It is called ‘KNIME_predict cylinder’. It is almost working and I did all of it myself.

Can you please look at it and tell me why the “Keras Network Learner” is not working?

I would appreciate if you can help me resolve this last barrier. I think it is the last issue before I can start with training my model.

Many, many thanks!
Leon

Hi Leon,

it’s good to have you back.
I took a look at your workflow but I have to admit that I don’t fully understand it.
Why is the input shape of your network [?, 101]? I would expect either [?, 1] or [?, 3] depending on whether you had only the volume sequence or also the radius and length as part of the sequence.

Cheers,
Adrian

1 Like

Hi Adrian,

I was working through ‘10_Generate_Product_Names_With_LSTM’ and used my own list to upload to play around with the model since it had some things in common with with I am doing here.

[?, 101] was done in ignorance and left there as a sort of remnant from that example.

I have changed it to [?, 3] now since radius and length is certainly included. It is however included in the [input] vector.

Please don’t worry about my whole generation of data but only concern yourself with the last 4 noted please.

Even after making that change it does not work.

I will also change it on the hub example

As always many thanks for helping!
Leon

Ah I see, that explains it.
Something I recognized in your workflow is that you use the One-hot converters (probably also a remnant from our example workflow). For your application you will want to change those to “From Collection of Number (double)”.
I’d also suggest you don’t include the radius and length in the sequence, as creating the sequence becomes tricky then.
Instead I would supply those two via a separate input layer that is concatenated with the output of the LSTM layer before the final prediction.
The reasoning behind this approach is that the model needs the radius and length only at the end to decide whether the cylinder is filled or not.

Best,
Adrian

2 Likes

Hi Adrian,

I have simplified the workflow and posted it on my public hub. It contains only the last steps now.

knime://My-KNIME-Hub/Users/knimeoutjie/Public/KNIME_predict%20cylinder(2)
knime://My-KNIME-Hub/Users/knimeoutjie/Public/KNIME_predict%20cylinder(2).table

At least I am training now, but not very accurately. That is because I have not included Length and Radius as you said I should. I did not know where to put the second input layer, neither how to concatenate it as you suggested.

However I saw something insanely crazy when I trained it as is…once, only once did it actually spike to a relative accurate (I guess this is automatically in sample testing) prediction.

Check this out; keep in mind this is without length and radius.

For all the other training instances I got the same every time; some accuracy around 0.1. I guess this makes sense while radius and length is excluded.

Can you please tell me how to add the second input layer? Also comment on that crazy jump in accuracy I have seen that one time.

Thanks,
Leon

1 Like

Hi Leon,

I can’t really answer your question regarding the spike in accuracy without digging further into your workflow but I can answer you other question. Here you go:

Cheers,
Adrian

4 Likes

Hi Adrian,

Thanks a million for all the help in the past few weeks, you have really helped me incredibly much.

If you dont mind, can you please check out " Multiple Sequence to Vector for RNN with Keras"

This is really where it would bridge to my real data-set.

Million thanks again!!!
Leon

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.