(lookup_layer, word_idict)
return d
Extract RNN embeddings from the lookup layer of the model

    Function modified from:
    https://github.com/ryankiros/skip-thoughts/blob/master/training/tools.py
Extract RNN embeddings from the lookup layer of the model
Extract RNN embeddings from the lookup layer of the model
def get_embeddings(lookup_layer, word_idict):
    """
    Extract RNN embeddings from the lookup layer of the model

    Function modified from:
    https://github.com/ryankiros/skip-thoughts/blob/master/training/tools.py
    """
    f_emb = lookup_layer.W.get()
    d = OrderedDict()
    for i in range(f_emb.shape[0]):
        ff = f_emb[i].flatten()
        d[word_idict[i]] = ff
    return d
def get_embeddings ( lookup_layer , word_idict ) : f_emb = lookup_layer . W . get ( ) d = OrderedDict ( ) for i in range ( f_emb . shape [ 0 ] ) : ff = f_emb [ i ] . flatten ( ) d [ word_idict [ i ] ] = ff return d