ws = WarmStartSettings(ckpt_to_initialize_from="/tmp/model-1000")
```
- Warm-start only the embeddings (input layer) and their accumulator variables:
+ Warm-start only the embeddings (input layer):
```
ws = WarmStartSettings(ckpt_to_initialize_from="/tmp",
vars_to_warm_start=".*input_layer.*")
```
- Warm-start everything except the optimizer accumulator variables
- (DNN defaults to Adagrad):
-
- ```
- ws = WarmStartSettings(ckpt_to_initialize_from="/tmp",
- vars_to_warm_start="^(?!.*(Adagrad))")
- ```
-
Warm-start all weights but the embedding parameters corresponding to
`sc_vocab_file` have a different vocab from the one used in the current
model:
# Both warm_start_settings.vars_to_warm_start = '.*' and
# warm_start_settings.vars_to_warm_start = None will match everything here.
for v in ops.get_collection(
+ # TODO(eddz): Allow for different collections here (to support
+ # warm-starting accumulators).
ops.GraphKeys.TRAINABLE_VARIABLES,
scope=warm_start_settings.vars_to_warm_start):
if not isinstance(v, list):