adventures-in-ml-code icon indicating copy to clipboard operation
adventures-in-ml-code copied to clipboard

Keras word2vec is much more faster than tensorflow word2vec ?

Open muthiyanbhushan opened this issue 7 years ago • 1 comments

Thanks for your work. I had a question about word2vec.

I ran both of your codes of word2vec viz Keras_word2vec.py and tf_word2vec.py !!

Keras word2vec with Tensorflow backend seems faster than Tensorflow word2vec. Ideally it should not. Keras is indirectly calling Tensorflow. Tensorflow code took 1182 sec to run 15 iterations whereas Keras just took 796 seconds to run 15 iterations.

How is Keras faster than Tensorflow?

Can you please help me? My CPU instance:

AWS Instance: C4.4 Large (Compute Optimized). Intel® Xeon® CPU ES-2666 V3 @ 2.90 GHz No. of CPU Cores = 16 2-CPU with 8 Cores/CPU Memory = 30 GB FPU = Yes

Thanks.

muthiyanbhushan avatar Jan 23 '18 00:01 muthiyanbhushan

it looks like the tensorflow uses a different function to calculate loss compared to the keras version, so the two are not comparable.

Santosh-Gupta avatar Mar 10 '19 01:03 Santosh-Gupta