Home
last modified time | relevance | path

Searched refs:trainable_variables (Results 1 – 25 of 565) sorted by relevance

12345678910>>...23

/external/tensorflow/tensorflow/python/ops/
Dtemplate.py329 trainable_variables = ops.get_collection_ref(
334 if trainable_at_start != len(trainable_variables):
338 (trainable_variables[trainable_at_start:],))
427 def trainable_variables(self): member in Template
440 trainable_variables = set(self.trainable_variables)
441 return [x for x in global_variables if x not in trainable_variables]
469 return self.trainable_variables
530 def trainable_variables(self): member in _EagerTemplateVariableStore
532 self._eager_variable_store.trainable_variables())
601 trainable_at_start = self._template_store.trainable_variables()
[all …]
/external/tensorflow/tensorflow/python/eager/benchmarks/resnet50/
Dhvp_test.py35 model.trainable_variables, vector) as acc:
40 grads = grad_tape.gradient(loss, model.trainable_variables)
46 grad_tape.watch(model.trainable_variables)
48 model.trainable_variables, vector) as acc:
52 return grad_tape.gradient(acc.jvp(loss), model.trainable_variables)
60 variables = model.trainable_variables
73 grads = inner_tape.gradient(loss, model.trainable_variables)
75 grads, model.trainable_variables, output_gradients=vector)
96 vector = [tf.ones_like(v) for v in model.trainable_variables]
103 for hvp_component, variable in zip(hvp, model.trainable_variables):
[all …]
/external/tensorflow/tensorflow/python/keras/layers/
Dmulti_head_attention_test.py128 self.assertLen(test_layer._query_dense.trainable_variables, 2)
129 self.assertLen(test_layer._output_dense.trainable_variables, 2)
131 self.assertLen(test_layer._query_dense.trainable_variables, 1)
132 self.assertLen(test_layer._output_dense.trainable_variables, 1)
305 len(model.trainable_variables), len(reloaded_model.trainable_variables))
306 for src_v, loaded_v in zip(model.trainable_variables,
307 reloaded_model.trainable_variables):
325 len(model.trainable_variables), len(reloaded_model.trainable_variables))
326 for src_v, loaded_v in zip(model.trainable_variables,
327 reloaded_model.trainable_variables):
/external/tensorflow/tensorflow/python/keras/tests/
Dsaved_model_test.py51 trainable_variables = self.dense.trainable_variables
52 gradients = tape.gradient(loss, trainable_variables)
53 self.optimizer.apply_gradients(zip(gradients, trainable_variables))
Dtracking_util_test.py118 variables = model.trainable_variables
126 variables = other_model.trainable_variables
208 variables = model.trainable_variables
285 variables = model.trainable_variables
307 variables = model.trainable_variables
344 variables = model.trainable_variables
624 variables = model.trainable_variables
655 variables = model.trainable_variables
683 variables = model.trainable_variables
775 variables = model.trainable_variables
[all …]
/external/tensorflow/tensorflow/python/keras/premade/
Dwide_deep.py123 linear_vars = self.linear_model.trainable_variables
124 dnn_vars = self.dnn_model.trainable_variables
132 trainable_variables = self.trainable_variables
133 grads = tape.gradient(loss, trainable_variables)
134 self.optimizer.apply_gradients(zip(grads, trainable_variables))
/external/tensorflow/tensorflow/python/keras/legacy_tf_layers/
Dconvolutional_test.py269 self.assertEqual(len(variables.trainable_variables()), 2)
271 self.assertEqual(len(variables.trainable_variables()), 2)
279 self.assertEqual(len(variables.trainable_variables()), 2)
282 self.assertEqual(len(variables.trainable_variables()), 2)
291 weights = variables.trainable_variables()
307 self.assertEqual(len(variables.trainable_variables()), 2)
309 self.assertEqual(len(variables.trainable_variables()), 4)
442 self.assertEqual(len(variables.trainable_variables()), 3)
444 self.assertEqual(len(variables.trainable_variables()), 3)
452 self.assertEqual(len(variables.trainable_variables()), 3)
[all …]
/external/tensorflow/tensorflow/python/keras/integration_test/
Dforwardprop_test.py169 for v in layer.trainable_variables:
216 [input_value] + layer.trainable_variables)
219 [input_value] + layer.trainable_variables)
254 vector = tape.gradient(loss, model.trainable_variables)
257 [model.trainable_variables], [vector])
259 tape.watch(model.trainable_variables)
261 first_grads = tape.gradient(loss, model.trainable_variables)
263 first_grads, model.trainable_variables, output_gradients=vector)
Dfunction_test.py59 trainable_variables = self.trainable_variables
60 gradients = tape.gradient(loss, trainable_variables)
61 self.optimizer.apply_gradients(zip(gradients, trainable_variables))
175 layer_variables = layer.trainable_variables
198 layer_variables = layer.trainable_variables
Dgradient_checkpoint_test.py102 tr_vars = model.trainable_variables
128 model1.trainable_variables + model2.trainable_variables +
129 model3.trainable_variables)
Dsaved_model_test.py56 trainable_variables = self.dense.trainable_variables
57 gradients = tape.gradient(loss, trainable_variables)
58 self.optimizer.apply_gradients(zip(gradients, trainable_variables))
141 train_vars = self.layer.trainable_variables
/external/tensorflow/tensorflow/compiler/tests/
Dadadelta_test.py80 self.assertNotIn(slot[0], variables.trainable_variables())
84 self.assertNotIn(slot_update[0], variables.trainable_variables())
88 self.assertNotIn(slot[1], variables.trainable_variables())
92 self.assertNotIn(slot_update[1], variables.trainable_variables())
Dmomentum_test.py58 self.assertFalse(slot0 in variables.trainable_variables())
61 self.assertFalse(slot1 in variables.trainable_variables())
144 self.assertFalse(slot0 in variables.trainable_variables())
147 self.assertFalse(slot1 in variables.trainable_variables())
/external/tensorflow/tensorflow/python/kernel_tests/
Dtemplate_test.py350 self.assertEqual(1, len(nested1.trainable_variables))
351 self.assertEqual(1, len(nested2.trainable_variables))
352 self.assertIs(nested1.trainable_variables[0], v1)
353 self.assertIs(nested2.trainable_variables[0], v2)
371 for v, w in zip(tmpl1.trainable_variables, [v1, v2]):
380 for v, w in zip(tmpl2.trainable_variables, [v5, v6]):
422 self.assertIs(nested1.trainable_variables[0], v1[0])
423 self.assertIs(nested2.trainable_variables[0], v2[0])
655 self.assertEqual([], list(ta.trainable_variables))
656 self.assertEqual([], list(tb.trainable_variables))
[all …]
Drnn_test.py376 trainable_variables = ops_lib.get_collection(
379 trainable_variables)
395 trainable_variables = ops_lib.get_collection(
398 trainable_variables)
509 trainable_variables = ops_lib.get_collection(
512 trainable_variables)
577 trainable_variables = ops_lib.get_collection(
580 trainable_variables)
643 trainable_variables = ops_lib.get_collection(
646 trainable_variables)
/external/tensorflow/tensorflow/python/training/
Dadadelta_test.py90 self.assertFalse(slot[0] in variables.trainable_variables())
94 self.assertFalse(slot_update[0] in variables.trainable_variables())
98 self.assertFalse(slot[1] in variables.trainable_variables())
102 self.assertFalse(slot_update[1] in variables.trainable_variables())
/external/tensorflow/tensorflow/python/ops/parallel_for/
Dgradients_test.py147 weights = variables.trainable_variables()
174 return gradient_ops.gradients(activation, variables.trainable_variables())
180 loop_fn_dtypes = [x.dtype for x in variables.trainable_variables()]
198 return gradient_ops.gradients(output, variables.trainable_variables())
209 loop_fn_dtypes = [x.dtype for x in variables.trainable_variables()]
294 return gradient_ops.gradients(loss, variables.trainable_variables())
298 loop_fn, [dtypes.float32] * len(variables.trainable_variables()),
321 logits, variables.trainable_variables(), use_pfor=use_pfor)
328 [dtypes.float32] * len(variables.trainable_variables()), batch_size)
337 jacobians = gradients.jacobian(output, variables.trainable_variables())
[all …]
/external/tensorflow/tensorflow/python/keras/distribute/
Dtest_example.py50 return optimizer.minimize(loss_fn, lambda: layer.trainable_variables)
93 return optimizer.minimize(loss_fn, lambda: layer.trainable_variables)
Dctl_correctness_test.py122 grads = tape.gradient(loss, model.trainable_variables)
123 optimizer.apply_gradients(zip(grads, model.trainable_variables))
183 grads = tape.gradient(loss, model.trainable_variables)
184 optimizer.apply_gradients(zip(grads, model.trainable_variables))
Dsharded_variable_test.py58 self.assertAllEqual(layer.trainable_weights, layer.trainable_variables)
102 self.assertAllEqual(layer.trainable_weights, layer.trainable_variables)
Dmirrored_strategy_test.py119 grads = tape.gradient(loss, model.trainable_variables)
120 optimizer.apply_gradients(list(zip(grads, model.trainable_variables)))
/external/tensorflow/tensorflow/python/training/tracking/
Ddata_structures.py222 trainable_variables = []
225 trainable_variables += obj.trainable_variables
229 return trainable_variables + trainable_extra_variables
246 trainable_variables = []
249 trainable_variables += obj.trainable_variables
252 trainable_variables + trainable_extra_variables +
265 def trainable_variables(self): member in TrackableDataStructure
/external/tensorflow/tensorflow/python/distribute/
Dsingle_loss_example.py73 return optimizer.minimize(loss_fn, lambda: layer.trainable_variables)
116 return optimizer.minimize(loss_fn, lambda: layer.trainable_variables)
/external/tensorflow/tensorflow/python/module/
Dmodule_test.py239 self.assertEqual(m.trainable_variables,
241 self.assertEqual(m.child.trainable_variables,
243 self.assertEqual(m.child.child.trainable_variables, (m.child.child.w,))
247 self.assertEqual(len(m.trainable_variables), 0)
248 self.assertEqual(len(m.child.trainable_variables), 0)
249 self.assertEqual(len(m.child.child.trainable_variables), 0)
/external/tensorflow/tensorflow/compiler/mlir/tfr/examples/mnist/
Dmnist_train.py152 grads = tape.gradient(loss_value, model.trainable_variables)
155 optimizer.apply_gradients(zip(grads, model.trainable_variables))

12345678910>>...23