-
Notifications
You must be signed in to change notification settings - Fork 1
/
path_generation.py
71 lines (63 loc) · 1.86 KB
/
path_generation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class PathGenerator(object):
def __init__(self, gru, dataset, layers, batch_size, batch_norm, drop, attention, attn_type, beam_size=3):
attn = ''
dr = ''
bn = ''
if gru:
model = 'GRU'
else:
model = 'LSTM'
if attention:
attn = '_attn_' + attn_type
if batch_norm:
bn = '_bn'
if drop:
dr = '_dr'
beam = '_' + str(beam_size) + 'b'
self._model_path = './model_files/models/VGG16_{}_{}l{}{}{}.json'.format(
model,
layers,
bn,
dr,
attn)
self._weights_path = './model_files/weights/VGG16_{}_{}_{}l_{}b{}{}{}.hdf5'.format(
model,
dataset,
layers,
batch_size,
bn,
dr,
attn)
self._callbacks_path = './model_files/callbacks/VGG16_{}_{}_{}l_{}b{}{}{}.csv'.format(
model,
dataset,
layers,
batch_size,
bn,
dr,
attn)
self._captions_path = './model_files/captions/VGG16_{}_{}_{}l_{}b{}{}{}{}.txt'.format(
model,
dataset,
layers,
batch_size,
bn,
dr,
attn,
beam)
def get_model_path(self):
return self._model_path
def set_model_path(self, path):
self._model_path = path
def get_weights_path(self):
return self._weights_path
def set_weights_path(self, path):
self._weights_path = path
def get_callbacks_path(self):
return self._callbacks_path
def set_callbacks_path(self, path):
self._callbacks_path = path
def get_captions_path(self):
return self._captions_path
def set_captions_path(self, path):
self._captions_path = path