Comments (4)
BTW, this is what I used to build the model.npz.pkl for the model argument -
import capgen as cp
import numpy as np
import cPickle as c
from collections import OrderedDict
import theano
options = {'dim_word':100, # word vector dimensionality
'ctx_dim':512, # context vector dimensionality
'dim':1000, # the number of LSTM units
'attn_type':'stochastic', # [see section 4 from paper]
'n_layers_att':1, # number of layers used to compute the attention weights
'n_layers_out':1, # number of layers used to compute logit
'n_layers_lstm':1, # number of lstm layers
'n_layers_init':1, # number of layers to initialize LSTM at time 0
'lstm_encoder':False, # if True, run bidirectional LSTM on input units
'prev2out':False, # Feed previous word into logit
'ctx2out':False, # Feed attention weighted ctx into logit
'alpha_entropy_c':0.002, # hard attn param
'RL_sumCost':True, # hard attn param
'semi_sampling_p':0.5, # hard attn param
'temperature':1., # hard attn param
'patience':10,
'max_epochs':5000,
'dispFreq':100,
'decay_c':0., # weight decay coeff
'alpha_c':0., # doubly stochastic coeff
'lrate':0.01, # used only for SGD
'selector':False, # selector (see paper)
'n_words':10000, # vocab size
'maxlen':100, # maximum length of the description
'optimizer':'adam',
'batch_size ': 16,
'valid_batch_size ': 16,
'saveto':'model.npz', # relative path of saved model file
'validFreq':1000,
'saveFreq':1000, # save the parameters after every saveFreq updates
'sampleFreq':100, # generate some samples after every sampleFreq updates
'dataset':'flickr30k',
'dictionary':None, # word dictionary
'use_dropout':False, # setting this true turns on dropout at various points
'use_dropout_lstm':False, # dropout on lstm gates
'reload_':True,
'save_per_epoch':False}
params = cp.init_params(options)
for kk, pp in options.iteritems():
params[kk] = options[kk]
tparams = OrderedDict()
print type(tparams)
for kk, pp in params.iteritems():
tparams[kk] = theano.shared(params[kk], name=kk)
f = open('/home/f0z/feat/flickr30k/model.npz.pkl', 'wb')
c.dump(params, f)
from arctic-captions.
The issue is resolved by importing capgen inside the process.
from arctic-captions.
@f0z Please, was you able to replicate the results of the paper using these hyperparameters on flickr_30k? How long (how many training epoch) did it take? Thank you.
from arctic-captions.
@f0z I have the same problem. Can you describe more specifically where you import capgen? I try import capgen at the beginning of the function gen_model() in the file of generate_caps.py. But it doesn't resolve the problem. Thanks
from arctic-captions.
Related Issues (20)
- Instructions to re-train the model: where to start?
- Instruction to visualize hard attention HOT 3
- argument 'model' in the 'main function' (generate_caps.py)
- Split problem
- cannot figure out the code
- How soon does the sanity check look like working fine?
- where is model_name.npz? HOT 2
- Bug in doubly stochastic attention?
- A bug in setting Adam optimizer learning rate? HOT 2
- Trained Models HOT 2
- Questions or bugs in the adam optimizer HOT 1
- why don't finetune cnn? HOT 1
- question about "doubly stochastic attention" HOT 2
- How to get start and How the convolution works out HOT 3
- Can I get pkl files?
- f_init = theano.function([ctx], [ctx]+init_state+init_memory, name='f_init', profile=False)
- Where can I get "model_name.npz" to run the Jupyter Notebook example? HOT 1
- Dataset Format and Flow of Code
- Tensoflow implementation of this model?
- Step by step readme file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arctic-captions.