code
stringlengths
3
6.57k
dataReaders.append(InventoryReader(privateDatabaseAccessConfiguration)
print("The GLAMOS database is available. Glacier objects are read from the database.")
glacierReader.getGlacierBySgi(focusGlacier)
glaciers.values()
dataReader.getData(glacier)
printLatestOutline(glaciers)
print("Database not available! Application will terminate.")
sys.exit(2)
print(e.message)
print("Sample script aborted!")
create_model(self, kernel_regularizer=None, activity_regularizer=None)
keras.models.Sequential()
get_data(self)
np_utils.to_categorical(y_train, NUM_CLASSES)
np_utils.to_categorical(y_test, NUM_CLASSES)
return (x_train, y_train)
create_multi_input_model_from(self, layer1, layer2)
keras.layers.Input(shape=(DATA_DIM,)
keras.layers.Input(shape=(DATA_DIM,)
layer1(input_1)
layer2(input_2)
keras.layers.Average()
keras.models.Model([input_1, input_2], out)
model.add_loss(keras.backend.mean(out2)
model.add_loss(math_ops.reduce_sum(input_1)
regularizers.l1()
regularizers.l2()
regularizers.l1_l2()
test_kernel_regularization(self, regularizer)
self.get_data()
self.create_model(kernel_regularizer=regularizer)
testing_utils.should_run_eagerly()
testing_utils.should_run_tf_function()
self.assertEqual(len(model.losses)
model.fit(x_train, y_train, batch_size=10, epochs=1, verbose=0)
regularizers.l1()
regularizers.l2()
regularizers.l1_l2()
keras.regularizers.l2(0.)
test_activity_regularization(self, regularizer)
self.get_data()
self.create_model(activity_regularizer=regularizer)
testing_utils.should_run_eagerly()
testing_utils.should_run_tf_function()
self.assertEqual(len(model.losses)
context.executing_eagerly()
model.fit(x_train, y_train, batch_size=10, epochs=1, verbose=0)
test_zero_regularization(self)
np.ones((10, 10)
np.ones((10, 3)
keras.layers.Dense(3, kernel_regularizer=keras.regularizers.l2(0)
testing_utils.should_run_eagerly()
testing_utils.should_run_tf_function()
model.fit(x, y, batch_size=5, epochs=1)
test_custom_regularizer_saving(self)
my_regularizer(weights)
math_ops.reduce_sum(math_ops.abs(weights)
keras.Input((10,)
keras.layers.Dense(1, kernel_regularizer=my_regularizer)
keras.Model(inputs, outputs)
model.get_config()
self.assertEqual(model2.layers[1].kernel_regularizer, my_regularizer)
regularizers.l1()
regularizers.l2()
regularizers.l1_l2()
test_regularization_shared_layer(self, regularizer)
self.create_multi_input_model_from(dense_layer, dense_layer)
testing_utils.should_run_eagerly()
testing_utils.should_run_tf_function()
self.assertLen(model.losses, 5)
regularizers.l1()
regularizers.l2()
regularizers.l1_l2()
test_regularization_shared_model(self, regularizer)
keras.layers.Input(shape=(DATA_DIM,)
keras.models.Model(input_tensor, dense_layer(input_tensor)
self.create_multi_input_model_from(dummy_model, dummy_model)
testing_utils.should_run_eagerly()
testing_utils.should_run_tf_function()
self.assertLen(model.losses, 6)
regularizers.l1()
regularizers.l2()
regularizers.l1_l2()
test_regularization_shared_layer_in_different_models(self, regularizer)
range(2)
keras.layers.Input(shape=(DATA_DIM,)
unshared_dense(shared_dense(input_tensor)
models.append(keras.models.Model(input_tensor, out)
testing_utils.should_run_eagerly()
testing_utils.should_run_tf_function()
self.assertLen(model.losses, 9)
test.main()
sys.path.insert(0, os.path.abspath(os.path.join(os.path.abspath(os.pardir)
sys.path.insert(0, os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(__file__)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", 'termsandconditions_demo.settings')
get_wsgi_application()
Greeter(helloworld_pb2_grpc.GreeterServicer)
Greet(self, request, context)
print('Saying `hello` to %s' % request.name)
helloworld_pb2.GreetResponse(message='Hello, {}!'.format(request.name)