Deep Learning for humans

Overview

Keras: Deep Learning for Python

Keras logo

Under Construction

In the near future, this repository will be used once again for developing the Keras codebase. For the time being, the Keras codebase is being developed at tensorflow/tensorflow, and any PR or issue should be directed there.

Comments
  • model.save and load giving different result

    model.save and load giving different result

    I am trying to save a simple LSTM model for text classification. The input of the model is padded vectorized sentences.

    model = Sequential()
    model.add(LSTM(40, input_shape=(16, 32)))
    model.add(Dense(20))
    model.add(Dense(8, activation='softmax'))
    model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
    

    For saving I'm using the following snippet:

    for i in range(50):
        from sklearn.cross_validation import train_test_split
    
        data_train, data_test, labels_train, labels_test = train_test_split(feature_set, dummy_y, test_size=0.1, random_state=i)
        accuracy = 0.0
        try:
            with open('/app/accuracy', 'r') as file:
                for line in file:
                    accuracy = float(line)
        except Exception:
            print("error")
        model.fit(data_train, labels_train, nb_epoch=50)
        loss, acc = model.evaluate(feature_set, dummy_y)
        if acc > accuracy:
            model.save_weights("model.h5", overwrite=True)
            model.save('my_model.h5', overwrite=True)
            print("Saved model to disk.\nAccuracy:")
            print(acc)
            with open('/app/accuracy', 'w') as file:
                file.write('%f' % acc)
    

    But whenever I'm trying to load the same model

    from keras.models import load_model
    model = load_model('my_model.h5')
    

    I'm getting random accuracy like an untrained model. same result even when trying to load weights separately. If I set the weights

    lstmweights=model.get_weights()
    model2.set_weights(lstmweights)
    

    like above. It is working if model and model2 are run under same session (same notebook session). If I serialize lstmweights and try to load it from different place, again I'm getting result like untrained model. It seems saving only the weights are not enough. So why model.save is not working. Any known point?

    opened by dipanjannag 315
  • is the Sequence to Sequence learning right?

    is the Sequence to Sequence learning right?

    Assume we are trying to learn a sequence to sequence map. For this we can use Recurrent and TimeDistributedDense layers. Now assume that the sequences have different lengths. We should pad both input and desired sequences with zeros, right? But how will the objective function handle the padded values? There is no choice to pass a mask to the objective function. Won't this bias the cost function?

    opened by EderSantana 219
  • Does Keras support using multiple GPUs?

    Does Keras support using multiple GPUs?

    Theano has supported multiple GPUs since v0.8.0. (cf. Using multiple GPUs — Theano 0.8.0 documentation ) Does Keras also support using multiple GPUs?

    For example, can I run the below task?

    1. Learn a sequential model A on gpu0
    2. Learn a sequential model B on gpu1
    3. Merge A and B on gpu0
    opened by henry0312 162
  • "real time" recurrent nets

    Hey guys,

    I was wondering how are the initial internal states in a recurrent layer dealt with? So far it appears they are reset are every run. Is there any way to preserve them?

    I'd like to be able to feed a .predict_proba() function data one time step at a time for a time series task, as the points come in, without also feeding the entire history all over again. Is this somehow possible? Thanks

    opened by lemuriandezapada 131
  • Change BN layer to use moving mean/var if frozen

    Change BN layer to use moving mean/var if frozen

    During fine-tuning, if a Batch Normalization layer is frozen it uses the mini-batch statistics. I believe this is incorrect and it can lead to reduced accuracy especially when we use Transfer learning. A better approach in this case would be to use the values of the moving mean and variance.

    Changes on this PR: In this PR I update the Batch Normalization layer to use the learned statistics if frozen during training. This is achieved by making the trainable flag part of the computational graph and by depending the behavior of the BN not only on the learning_phase but also on the value of the trainable property.

    Brief explanation: Assume we use one of the pre-trained CNNs of Keras and we want to fine-tune it. Unfortunately, we get no guarantees that the mean and variance of our new dataset inside the BN layers will be similar to the ones of the original dataset. As a result, if we fine-tune the top layers, their weights will be adjusted to the mean/variance of the new dataset. Nevertheless, during inference the top layers will receive data which are scaled using the mean/variance of the original dataset. This discrepancy can lead to reduced accuracy.

    I understand that this is a significant change that requires thorough review. To faciliate the situation I've documented why making such a change is important and provided detailed comparisons before and after applying the patch on my blog.

    EDIT: Since the fix was not merged on master, I maintain unofficial patches available for Keras 2.1.6, Keras 2.2.2 and Keras 2.2.4.

    opened by datumbox 116
  • How to add Attention on top of a Recurrent Layer (Text Classification)

    How to add Attention on top of a Recurrent Layer (Text Classification)

    I am doing text classification. Also I am using my pre-trained word embeddings and i have a LSTM layer on top with a softmax at the end.

    vocab_size = embeddings.shape[0]
    embedding_size = embeddings.shape[1]
    
    model = Sequential()
    
    model.add(Embedding(
            input_dim=vocab_size,
            output_dim=embedding_size,
            input_length=max_length,
            trainable=False,
            mask_zero=True,
            weights=[embeddings]
        ))
    
    model.add(LSTM(200, return_sequences=False))
    model.add(Dropout(0.5))
    
    model.add(Dense(3, activation='softmax', activity_regularizer=activity_l2(0.0001)))
    

    Pretty simple. Now I want to add attention to the model, but i don't know how to do it.

    My understanding is that i have to set return_sequences=True so as the attention layer will weigh each timestep accordingly. This way the LSTM will return a 3D Tensor, right? After that what do i have to do? Is there a way to easily implement a model with attention using Keras Layers or do i have to write my own custom layer?

    If this can be done with the available Keras Layers, I would really appreciate an example.

    opened by cbaziotis 116
  • Incorporating Word Vectors rather than using an Embedding class

    Incorporating Word Vectors rather than using an Embedding class

    I am solving an NLP task and I am trying to model it directly as a sequence using different RNN flavors. How can I use my own Word Vectors rather than using an instance of layers.embeddings.Embedding?

    opened by vindiesel 111
  • Tensorflow backend - bug in model._make_predict_function(...)

    Tensorflow backend - bug in model._make_predict_function(...)

    There appears to be a bug in the make_predict_function for the tensorflow backend. The following error message appears for me when trying to call model.predict(...)

    self._make_predict_function()
      File "/usr/local/lib/python3.4/dist-packages/keras/engine/training.py", line 679, in _make_predict_function
        **self._function_kwargs)
      File "/usr/local/lib/python3.4/dist-packages/keras/backend/tensorflow_backend.py", line 615, in function
        return Function(inputs, outputs, updates=updates)
      File "/usr/local/lib/python3.4/dist-packages/keras/backend/tensorflow_backend.py", line 589, in __init__
        with tf.control_dependencies(self.outputs):
      File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 3192, in control_dependencies
        return get_default_graph().control_dependencies(control_inputs)
      File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 2993, in control_dependencies
        c = self.as_graph_element(c)
      File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 2291, in as_graph_element
        raise ValueError("Tensor %s is not an element of this graph." % obj)
    ValueError: Tensor Tensor("Sigmoid_2:0", shape=(?, 17), dtype=float32) is not an element of this graph.
    

    This does not happen when using the theano backend.

    Notes: The model is loaded from json, and is defined as follows:

        seq1=Input(dtype='int32',shape=(400,),name='input_text')
        seq2=Input(dtype='int32',shape=(20,),name='input_titles')
    
        embeddeding=Embedding(max_features,embedding_dims,dropout=0.3)
    
        encoding_1=embeddeding(seq1)
        encoding_2=embeddeding(seq2)
    
        filter_lengths = [1,3,6]
    
    
        def max_1d(X):
            return K.max(X, axis=1)
        convs1=[]
        convs2=[]
        for fl in filter_lengths:
    
            conv1=Convolution1D(nb_filter=nb_filter,
                            filter_length=fl,
                            border_mode='valid',
                            activation='relu',
                            subsample_length=1)(encoding_1)
            conv1=Lambda(max_1d, output_shape=(nb_filter,))(conv1)
            convs1.append(conv1)
    
            conv2=Convolution1D(nb_filter=nb_filter,
                            filter_length=fl,
                            border_mode='valid',
                            activation='relu',
                            subsample_length=1)(encoding_2)
            conv2=Lambda(max_1d, output_shape=(nb_filter,))(conv2)
            convs2.append(conv2)
    
        m=merge([*convs1,*convs2],mode='concat')
        m=Highway(activation='relu')(m)
        m=Highway(activation='relu')(m)
        m=Dropout(0.5)(m)
        hovedkategori_loss=Dense(labsHovedKat.shape[1],activation='sigmoid',name='hovedkategori')(m)
    
        m1=merge([hovedkategori_loss,m],mode='concat')
        underkategori_loss=Dense(labsUnderKat.shape[1],activation='sigmoid',name='underkategori')(m1)
    
        model=Model(input=[seq1,seq2],output=[hovedkategori_loss,underkategori_loss])
        model.compile(optimizer='adam',loss='binary_crossentropy',metrics={'hovedkategori':'accuracy','underkategori':'accuracy'})
    
    • [x] Check that you are up-to-date with the master branch of Keras. You can update with: pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
    • [x] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with: pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
    opened by Froskekongen 108
  • 'thread._local' object has no attribute 'value' error

    'thread._local' object has no attribute 'value' error

    I am loading a model from an hdf5 file with using keras.models.load_model. when i try to predict using that model the following error raises:

    'thread._local' object has no attribute 'value'

    the code is:

    ''' from keras.preprocessing.image import img_to_array from keras.models import load_model

    model_path = (''/home/pi/classifier/models/model.hdf5'') classifier = load_model(model_path, compile=False) preds = classifier.predict(img_to_array(image)) ''' where image is numpy array read by opencv

    Platform: Raspberry Pi 4 OS: Raspbian Buster TF version: 1.13.1 Keras version: 2.3.0

    opened by ycdaskin 101
  • No reproducible using tensorflow backend

    No reproducible using tensorflow backend

    with theano backend (CPU or GPU without cnDNN), I could train reproducible model by

    fixed_seed_num = 1234
    nunpy.random.seed(fixed_seed_num)
    random.seed(fixed_seed_num) # not sure if needed or not
    

    While in pure tensorflow without keras wrapper, it could also be reproducible by

    tersorflow.set_random_seed(fixed_seed_num)
    

    Don't know why, but in Keras + tensorflow backend, non of the above could give reproducible training model.

    Environment:

    • Keras: v0.3.2
    • tensorflow: v0.7.1
    • Macbook OS X v10.11.4
    • tensorflow is using CPU

    BTW: it would be great if keras could expose an unified API for reproducible training. something like:

    keras.set_random_seed(fixed_seed_num)
    
    opened by zhuoqiang 96
  • Is there a way in Keras to apply different weights to a cost function?

    Is there a way in Keras to apply different weights to a cost function?

    Hi there, I am trying to implement a classification problem with three classes: 0,1 and 2. I would like to fine tune my cost function so that missclassification is weighted some how. In particular, predicting 1 instead of 2 should give twice the cost than predicting 0. writing it in a table format, it should be something like that:

    Costs: Predicted: 0 | 1 | 2 __________________________ Actual 0 | 0 | 0.25 | 0.25 1 | 0.25 | 0 | 0.5 2 | 0.25 | 0.5 | 0

    I really like keras framework, it would be nice if it is possible to implement it and not having to dig into tensorflow or theano code.

    Thanks

    opened by ayalalazaro 95
  • invalid syntax trainer.trainModel()

    invalid syntax trainer.trainModel()

    Help me currently i am doing at Jupyter notebook anaconda i got invalid syntax when running this code trainer.trainModel() currently i am using Python 3.7.6 TenserflowVer: 2.4.0

    from imageai.Detection.Custom import DetectionModelTrainer

    trainer = DetectionModelTrainer() trainer.setModelTypeAsYOLOv3() trainer.setDataDirectory(data_directory="hololens") trainer.setTrainConfig(object_names_array=["hololens"], batch_size=4, num_experiments=100, train_from_pretrained_model=("pretrained-yolov3.h5") trainer.trainModel()

    image

    opened by faisalhazry 3
  • ConvNeXt `classifier_activation=softmax` returns linear layer

    ConvNeXt `classifier_activation=softmax` returns linear layer

    Describe the problem.

    Specifying classifier_activation=softmax in ConvNeXt models does not work, instead it returns the model with a linear classifier layer.

    Inspecting source code: https://github.com/keras-team/keras/blob/e6784e4302c7b8cd116b74a784f4b78d60e83c26/keras/applications/convnext.py#L524-L526

    Definition of Head function: https://github.com/keras-team/keras/blob/e6784e4302c7b8cd116b74a784f4b78d60e83c26/keras/applications/convnext.py#L327-L348

    Find the Colab gist here.

    If OK I can open a PR and fix it.

    opened by Frightera 0
  • Augmentation layers only active during training!

    Augmentation layers only active during training!

    Description of issue (what needs to be changed):. Correct links. https://keras.io/guides/preprocessing_layers/

    As it said, the following layers apply random augmentation transforms to a batch of images. They are only active during training.

    tf.keras.layers.RandomCrop tf.keras.layers.RandomFlip tf.keras.layers.RandomTranslation tf.keras.layers.RandomRotation tf.keras.layers.RandomZoom tf.keras.layers.RandomHeight tf.keras.layers.RandomWidth tf.keras.layers.RandomContrast

    So, in the model, if we use these layers, they will be active (i.e. model.fit / model(..., training=True) during training but will be inactive when we call model.evaluate and model.predict / model(..., training=False). A sample model would be

    model = keras.Sequential(
       [
          tf.keras.layers.RandomHeight,
          tf.keras.layers.RandomContrast,
          tf.keras.layers.Conv2D,
          tf.keras.layers.Dense
          ...
        ]
    )
    

    Queries

    • What if I want the augmentaiton layer be active in the prediction phase (i.e for making test-time-augmentaiton), using model.predict? We can use model(..., training=True) but (a). It's best suited for small amount of data, and (b). some other function (dropout) might be active.
    • Already checked it. https://github.com/keras-team/keras/blob/e6784e4302c7b8cd116b74a784f4b78d60e83c26/keras/backend.py#L451-L456
    type:docs 
    opened by innat 3
  • TerminateOnNaN epoch level callback

    TerminateOnNaN epoch level callback

    epoch frequency support for TerminateOnNaN callback.

    Batch level hook fails when used with distributed strategies, as logs is not of type dict (tensorflow.python.distribute.coordinator.values.RemoteValueImpl)

    keras-team-review-pending size:M 
    opened by abinthomasonline 2
  • using a custom layer, loaded_model cannot give the same predicted value compared with original model [results not reproducible]

    using a custom layer, loaded_model cannot give the same predicted value compared with original model [results not reproducible]

    System Info

    • Tensorflow Version: 2.4.3
    • Custom Code: Yes
    • OS Platform and Distribution: CentOS Linux release 8.2.2004
    • Python version: 3.8
    • CUDA/cuDNN version: CUDA11, cuDNN8
    • GPU model and memory: RTX 3090, 24268MiB

    Current Behaviour: I implemented a custom layer, and use this layer to build a model. After training it, the original model gave a predicted value A, and the original model is saved as a h5 file. Then I load model from the h5 file, but the loaded model gave a different predicted value B, which means the results are not reproducible. Normally, the two models are supposed to give the same predicted value. The custom layer is as simple as a Dense layer, and I have already locate that the custom layer caused the above problem. Actually, if I comment the line of custom layer, and uncomment the line below it (which is an original tf Dense layer), both the original model and the loaded_model gave the same results.

    Standalone code to reproduce the issue https://colab.research.google.com/drive/19_8DqzfC2JadKM9ZykJRLDEcxEkzjrT7?usp=sharing Can also refer to the link where the issue is firstly posted: https://github.com/tensorflow/tensorflow/issues/59041

    Relevant log output 2022-12-29 10:33:52.034627: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-12-29 10:33:53.136713: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set 2022-12-29 10:33:53.138072: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1 2022-12-29 10:33:53.198743: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties: pciBusID: 0000:3d:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2022-12-29 10:33:53.198834: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-12-29 10:33:53.203166: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11 2022-12-29 10:33:53.203273: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.11 2022-12-29 10:33:53.204328: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10 2022-12-29 10:33:53.204657: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10 2022-12-29 10:33:53.209031: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10 2022-12-29 10:33:53.209857: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.11 2022-12-29 10:33:53.210030: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8 2022-12-29 10:33:53.212456: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0 2022-12-29 10:33:53.335970: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-12-29 10:33:53.348062: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set 2022-12-29 10:33:53.349549: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties: pciBusID: 0000:3d:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2022-12-29 10:33:53.349604: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-12-29 10:33:53.349644: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11 2022-12-29 10:33:53.349654: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.11 2022-12-29 10:33:53.349664: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10 2022-12-29 10:33:53.349673: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10 2022-12-29 10:33:53.349682: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10 2022-12-29 10:33:53.349691: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.11 2022-12-29 10:33:53.349701: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8 2022-12-29 10:33:53.352041: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0 2022-12-29 10:33:53.352076: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-12-29 10:33:53.873305: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix: 2022-12-29 10:33:53.873357: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0 2022-12-29 10:33:53.873366: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N 2022-12-29 10:33:53.877072: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 22430 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:3d:00.0, compute capability: 8.6) /usr/local/lib64/python3.8/site-packages/tensorflow/python/data/ops/dataset_ops.py:3503: UserWarning: Even though the tf.config.experimental_run_functions_eagerly option is set, this option does not apply to tf.data functions. tf.data functions are still traced and executed as graphs. warnings.warn( 2022-12-29 10:33:53.990568: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2) 2022-12-29 10:33:53.997553: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 2600000000 Hz 2022-12-29 10:33:54.015124: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11 2022-12-29 10:33:54.679072: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.11 2022-12-29 10:33:54.679260: I tensorflow/stream_executor/cuda/cuda_blas.cc:1838] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once. 625/625 [==============================] - 5s 7ms/step - loss: 0.4327 [[0.44245386] [0.6916534 ] [0.49306032] [0.98741436] [0.7631112 ]] [[0.48893338] [0.54947186] [0.40105245] [0.56347597] [0.32270208]]

    opened by h44632186 0
  • Transform label to ordinal_regression label

    Transform label to ordinal_regression label

    System information.

    TensorFlow version (you are using): 2.9 Are you willing to contribute it (Yes/No) : Yes

    Describe the feature and the current behavior/state: Currently, I couldn't find any good implementation for converting label to ordinal-regression/classification label. Either people use for loop to do it or they convert labels element-wise rather than batch-wise.

    Describe the feature clearly here. Be sure to convey here why the requested feature is needed. Any brief description about the use-case would help.: This feature is needed for Ordinal Regression / Classification task. In tf.keras.utils there is to_categorical to convert labels to one_hot labels for classification. But for ordinal regression / classification we need to transform the labels differently. But currently tf.keras doesn't have the support of this feature.

    Here's an example of the feature with contrast to one_hot encoding,

    One Hot

    Input:

    label = np.array([0, 1, 2, 3, 1])
    one_hot = tf.keras.utils.to_categorical(label, num_classes=4)
    

    Output:

    [[1, 0, 0, 0],
     [0, 1, 0, 0],
     [0, 0, 1, 0],
     [0, 0, 0, 1],
     [0, 1, 0, 0]]
    

    Ordinal Regression / Classification

    Input:

    label = np.array([0, 1, 2, 3, 1])
    ordinal = to_ordinal(label, num_classes=4)
    

    Output:

    [[0, 0, 0],
     [1, 0, 0],
     [1, 1, 0],
     [1, 1, 1],
     [1, 0, 0]]
    

    Will this change the current api? How? This feature currently doesn't have any implementation.

    Who will benefit from this feature? All the members of the community. Ordinal regression/classification is quite interesting and getting popular day by day. But it is hardly mentioned in the literature how to transform the label for ordinal regression. I think this feature will be a nice addition to keras for everyone.

    Contributing

    • Do you want to contribute a PR? (yes/no): Yes
    • If yes, please read this page for instructions
    • Briefly describe your candidate solution(if contributing):

    Solution

    Following is the Numpy implementation but the same code can be used for TensorFlow as well,

    def to_ordinal(y, num_classes=None):
        if not num_classes:
            num_classes = np.max(y) + 1
        range_values = np.arange(num_classes-1)[None,:]
        range_values = np.tile(range_values, [y.shape[0], 1])
        ordinal_label = np.where(range_values < y[:, None], 1, 0)
        return ordinal_label
    
    type:feature 
    opened by awsaf49 0
Releases(v2.11.0)
  • v2.11.0(Nov 14, 2022)

    Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.11.0 for more details.

    Full Changelog: https://github.com/keras-team/keras/compare/v2.10.0...v2.11.0

    Source code(tar.gz)
    Source code(zip)
  • v2.11.0-rc3(Nov 9, 2022)

    What's Changed

    • Cherrypick pull request #17225 from lgeiger:fix-mixed-precision-ema by @qlzh727 in https://github.com/keras-team/keras/pull/17226

    Full Changelog: https://github.com/keras-team/keras/compare/v2.11.0-rc2...v2.11.0-rc3

    Source code(tar.gz)
    Source code(zip)
  • v2.11.0-rc2(Oct 24, 2022)

    What's Changed

    • Cherrypick for cl/482011499: Throw error on deprecated fields. by @qlzh727 in https://github.com/keras-team/keras/pull/17179

    Full Changelog: https://github.com/keras-team/keras/compare/v2.11.0-rc1...v2.11.0-rc2

    Source code(tar.gz)
    Source code(zip)
  • v2.11.0-rc1(Oct 20, 2022)

    Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.11.0-rc1 for more details.

    What's Changed

    • Fix TypeError positional argument when LossScalerOptimizer is used conjointly with tfa wrappers by @lucasdavid in https://github.com/keras-team/keras/pull/16332
    • Add type check to axis by @sachinprasadhs in https://github.com/keras-team/keras/pull/16208
    • minor documention fix by @bmatschke in https://github.com/keras-team/keras/pull/16331
    • Fix typos in data_adapter.py by @taegeonum in https://github.com/keras-team/keras/pull/16326
    • Add exclude_from_weight_decay to AdamW by @markub3327 in https://github.com/keras-team/keras/pull/16274
    • Switching learning/brain dependency to OSS compatible test_util by @copybara-service in https://github.com/keras-team/keras/pull/16362
    • Typo fix in LSTM docstring by @peskaf in https://github.com/keras-team/keras/pull/16364
    • Copy loss and metric to prevent side effect by @drauh in https://github.com/keras-team/keras/pull/16360
    • Denormalization layer by @markub3327 in https://github.com/keras-team/keras/pull/16350
    • Fix reset_states not working when invoked within a tf.function in graph mode. by @copybara-service in https://github.com/keras-team/keras/pull/16400
    • Reduce the complexity of the base layer by pulling out the logic related to handling call function args to a separate class. by @copybara-service in https://github.com/keras-team/keras/pull/16375
    • Add subset="both" functionality to {image|text}_dataset_from_directory() by @Haaris-Rahman in https://github.com/keras-team/keras/pull/16413
    • Fix non-float32 efficientnet calls by @hctomkins in https://github.com/keras-team/keras/pull/16402
    • Fix prediction with structured output by @itmo153277 in https://github.com/keras-team/keras/pull/16408
    • Add reference to resource variables. by @sachinprasadhs in https://github.com/keras-team/keras/pull/16409
    • added audio_dataset.py by @hazemessamm in https://github.com/keras-team/keras/pull/16388
    • Fix Syntax error for combined_model.compile of WideDeepModel by @gadagashwini in https://github.com/keras-team/keras/pull/16447
    • Missing f prefix on f-strings fix by @code-review-doctor in https://github.com/keras-team/keras/pull/16459
    • Update CONTRIBUTING.md by @rthadur in https://github.com/keras-team/keras/pull/15998
    • adds split_dataset utility by @prakashsellathurai in https://github.com/keras-team/keras/pull/16398
    • Support increasing batch size by @markus-hinsche in https://github.com/keras-team/keras/pull/16337
    • Add ConvNeXt models by @sayakpaul in https://github.com/keras-team/keras/pull/16421
    • Fix OrthogonalRegularizer to implement the (1,1) matrix norm by @Kiwiakos in https://github.com/keras-team/keras/pull/16521
    • fix: weight keys so that imagenet init works by @sayakpaul in https://github.com/keras-team/keras/pull/16528
    • Preprocess input correction by @AdityaKane2001 in https://github.com/keras-team/keras/pull/16527
    • Fix typo in documentation by @sushreebarsa in https://github.com/keras-team/keras/pull/16534
    • Update index_lookup.py by @tilakrayal in https://github.com/keras-team/keras/pull/16460
    • update codespaces bazel install by @haifeng-jin in https://github.com/keras-team/keras/pull/16575
    • reduce too long lines in engine/ by @haifeng-jin in https://github.com/keras-team/keras/pull/16579
    • Fix typos by @eltociear in https://github.com/keras-team/keras/pull/16568
    • Fix mixed precision serialization of group convs by @lgeiger in https://github.com/keras-team/keras/pull/16571
    • reduce layers line-too-long by @haifeng-jin in https://github.com/keras-team/keras/pull/16580
    • resolve line-too-long in root directory by @haifeng-jin in https://github.com/keras-team/keras/pull/16584
    • resolve line-too-long in metrics by @haifeng-jin in https://github.com/keras-team/keras/pull/16586
    • resolve line-too-long in optimizers by @haifeng-jin in https://github.com/keras-team/keras/pull/16587
    • resolve line-too-long in distribute by @haifeng-jin in https://github.com/keras-team/keras/pull/16594
    • resolve line-too-long in integration_test by @haifeng-jin in https://github.com/keras-team/keras/pull/16599
    • resovle line-too-long in legacy-tf-layers by @haifeng-jin in https://github.com/keras-team/keras/pull/16600
    • resolve line-too-long in initializers by @haifeng-jin in https://github.com/keras-team/keras/pull/16598
    • resolve line-too-long in api by @haifeng-jin in https://github.com/keras-team/keras/pull/16592
    • resolve line-too-long in benchmarks by @haifeng-jin in https://github.com/keras-team/keras/pull/16593
    • resolve line-too-long in feature_column by @haifeng-jin in https://github.com/keras-team/keras/pull/16597
    • resolve line-too-long in datasets by @haifeng-jin in https://github.com/keras-team/keras/pull/16591
    • resolve line-too-long in dtensor by @haifeng-jin in https://github.com/keras-team/keras/pull/16595
    • resolve line-too-long in estimator by @haifeng-jin in https://github.com/keras-team/keras/pull/16596
    • resolve line-too-long in applications by @haifeng-jin in https://github.com/keras-team/keras/pull/16590
    • resolve line-too-long in mixed_precision by @haifeng-jin in https://github.com/keras-team/keras/pull/16605
    • resolve line-too-long in models by @haifeng-jin in https://github.com/keras-team/keras/pull/16606
    • resolve line-too-long in premade_models by @haifeng-jin in https://github.com/keras-team/keras/pull/16608
    • resolve line-too-long in tests by @haifeng-jin in https://github.com/keras-team/keras/pull/16613
    • resolve line-too-long in testing_infra by @haifeng-jin in https://github.com/keras-team/keras/pull/16612
    • resolve line-too-long in saving by @haifeng-jin in https://github.com/keras-team/keras/pull/16611
    • resolve line-too-long in preprocessing by @haifeng-jin in https://github.com/keras-team/keras/pull/16609
    • resolve line-too-long in utils by @haifeng-jin in https://github.com/keras-team/keras/pull/16614
    • Optimize L2 Regularizer (use tf.nn.l2_loss) by @szutenberg in https://github.com/keras-team/keras/pull/16537
    • let the linter ignore certain lines, prepare to enforce line length by @haifeng-jin in https://github.com/keras-team/keras/pull/16617
    • Fix typo by @m-ahmadi in https://github.com/keras-team/keras/pull/16607
    • Explicitely set AutoShardPolicy.DATA for TensorLike datasets by @lgeiger in https://github.com/keras-team/keras/pull/16604
    • Fix all flake8 errors by @haifeng-jin in https://github.com/keras-team/keras/pull/16621
    • Update lint.yml by @haifeng-jin in https://github.com/keras-team/keras/pull/16648
    • Fix typo error of tf.compat.v1.keras.experimental for export and load model by @gadagashwini in https://github.com/keras-team/keras/pull/16636
    • Fix documentation in keras.datasets.imdb by @luckynozomi in https://github.com/keras-team/keras/pull/16673
    • Update init.py by @Wehzie in https://github.com/keras-team/keras/pull/16557
    • Fix documentation in keras.layers.attention.multi_head_attention by @balvisio in https://github.com/keras-team/keras/pull/16683
    • Fix missed parameter from AUC config by @weipeilun in https://github.com/keras-team/keras/pull/16499
    • Fix bug for KerasTensor._keras_mask should be None by @haifeng-jin in https://github.com/keras-team/keras/pull/16689
    • Fixed some spellings by @synandi in https://github.com/keras-team/keras/pull/16693
    • Fix batchnorm momentum in ResNetRS by @shkarupa-alex in https://github.com/keras-team/keras/pull/16726
    • Add variable definitions in optimizer usage example by @miker2241 in https://github.com/keras-team/keras/pull/16731
    • Fixed issue #16749 by @asukakenji in https://github.com/keras-team/keras/pull/16751
    • Fix usage of deprecated Pillow interpolation methods by @neoaggelos in https://github.com/keras-team/keras/pull/16746
    • :memo: Add typing to some callback classes by @gabrieldemarmiesse in https://github.com/keras-team/keras/pull/16692
    • Add support for Keras mask & causal mask to MultiHeadAttention by @ageron in https://github.com/keras-team/keras/pull/16619
    • Update standard name by @chunduriv in https://github.com/keras-team/keras/pull/16772
    • Fix error when labels contains brackets when plotting model by @cBournhonesque in https://github.com/keras-team/keras/pull/16739
    • Fixing the incorrect link in input_layer.py by @tilakrayal in https://github.com/keras-team/keras/pull/16767
    • Formatted callback.py to render correctly by @jvishnuvardhan in https://github.com/keras-team/keras/pull/16765
    • Fixed typo in docs by @ltiao in https://github.com/keras-team/keras/pull/16778
    • docs: Fix a few typos by @timgates42 in https://github.com/keras-team/keras/pull/16789
    • Add ignore_class to sparse crossentropy and IoU by @lucasdavid in https://github.com/keras-team/keras/pull/16712
    • Updated f-string method by @cyai in https://github.com/keras-team/keras/pull/16799
    • Fix NASNet input shape computation by @ianstenbit in https://github.com/keras-team/keras/pull/16818
    • Fix incorrect ref. to learning_rate_schedule during module import by @lucasdavid in https://github.com/keras-team/keras/pull/16813
    • Fixing the incorrect link in backend.py by @tilakrayal in https://github.com/keras-team/keras/pull/16806
    • Corrected DepthwiseConv1D docstring by @AdityaKane2001 in https://github.com/keras-team/keras/pull/16807
    • Typo and grammar: "recieved" by @ehrencrona in https://github.com/keras-team/keras/pull/16814
    • Fix typo in doc by @DyeKuu in https://github.com/keras-team/keras/pull/16821
    • Update README.md by @freddy1020 in https://github.com/keras-team/keras/pull/16823
    • Updated f-string method by @cyai in https://github.com/keras-team/keras/pull/16775
    • Add is_legacy_optimizer to optimizer config to keep saving/loading consistent. by @copybara-service in https://github.com/keras-team/keras/pull/16842
    • Used Flynt to update f-string method by @cyai in https://github.com/keras-team/keras/pull/16774
    • CONTRIBUTING.md file updated by @nivasgopi30 in https://github.com/keras-team/keras/pull/16084
    • Updated f-string method by @cyai in https://github.com/keras-team/keras/pull/16777
    • added an encoding parameter to TextVectorization layer by @tonyrubanraj in https://github.com/keras-team/keras/pull/16805
    • Incorrectly rendered table by @chunduriv in https://github.com/keras-team/keras/pull/16839
    • fix(v1): avoid calling training_v1.Model.metrics during PREDICT by @s22chan in https://github.com/keras-team/keras/pull/16603
    • Update tf.keras.preprocessing.image* to tf.keras.utils* by @chunduriv in https://github.com/keras-team/keras/pull/16864
    • Updating get_file() to respect KERAS_HOME environment variable by @adrianjhpc in https://github.com/keras-team/keras/pull/16877
    • Add f-string format and check with flynt for the whole codebase by @edumucelli in https://github.com/keras-team/keras/pull/16872
    • configurable distribute_reduction_method in Model. by @kretes in https://github.com/keras-team/keras/pull/16664
    • Fix docs of metrics parameter in compile by @matangover in https://github.com/keras-team/keras/pull/16893
    • [Refactoring] making the code more Succinct and Pythonic by @maldil in https://github.com/keras-team/keras/pull/16874
    • Fix Value Error for Units of tf.keras.layers.LSTM by @gadagashwini in https://github.com/keras-team/keras/pull/16929
    • Fix Value error for Units of tf.keras.layers.SimpleRNN by @gadagashwini in https://github.com/keras-team/keras/pull/16926
    • Fix value error for Units of tf.keras.layers.Dense by @gadagashwini in https://github.com/keras-team/keras/pull/16921
    • Fixed: #16936 broken hyperlink by @Anselmoo in https://github.com/keras-team/keras/pull/16937
    • Fix Value error of tf.keras.layers.GRU by @gadagashwini in https://github.com/keras-team/keras/pull/16963
    • Update Returns section in compute_output_shape by @chunduriv in https://github.com/keras-team/keras/pull/16955
    • Implement compute_output_shape() method for MultiHeadAttention #16951 by @Pouyanpi in https://github.com/keras-team/keras/pull/16989
    • Typo fixed by @edwardyehuang in https://github.com/keras-team/keras/pull/17000
    • PR for solving issue #16797 by @JaimeArboleda in https://github.com/keras-team/keras/pull/16870
    • Add imports to base_rnn example by @beyarkay in https://github.com/keras-team/keras/pull/17025
    • Update conv layer docs to reflect lack of CPU support for channels_first by @ianstenbit in https://github.com/keras-team/keras/pull/17034
    • Fixed Broken link of paper jozefowicz15 et al by @mohantym in https://github.com/keras-team/keras/pull/17038
    • GitHub Workflows security hardening by @sashashura in https://github.com/keras-team/keras/pull/17050
    • Update normalization.py to fix a bug when "denormalizing" by @Vincent-SV in https://github.com/keras-team/keras/pull/17054
    • Fix IndexError when outs is empty by @rhelmeczi in https://github.com/keras-team/keras/pull/17081
    • Fix typos in docstrings by @pitmonticone in https://github.com/keras-team/keras/pull/17096
    • EarlyStopping add initial warm-up #16793 by @inonbe in https://github.com/keras-team/keras/pull/17022
    • More Tests for customizable reduction strategy in model by @lucasdavid in https://github.com/keras-team/keras/pull/16922
    • Fix Batch Normalization inference behavior when virtual_batch_size is set by @myaaaaaaaaa in https://github.com/keras-team/keras/pull/17065
    • Include dictionary comprehension by @boneyag in https://github.com/keras-team/keras/pull/17119
    • Fixes ConvNeXt and RegNet when input_tensor is given by @shanejohnpaul in https://github.com/keras-team/keras/pull/17068
    • Cherrypick the fix for zlib by @qlzh727 in https://github.com/keras-team/keras/pull/17153
    • Cherrypick all the fixes since last branch cut to r2.11. by @qlzh727 in https://github.com/keras-team/keras/pull/17160
    • Cherrypick 2 more changes for the optimizer docstring fix. by @qlzh727 in https://github.com/keras-team/keras/pull/17165

    New Contributors

    • @bmatschke made their first contribution in https://github.com/keras-team/keras/pull/16331
    • @taegeonum made their first contribution in https://github.com/keras-team/keras/pull/16326
    • @markub3327 made their first contribution in https://github.com/keras-team/keras/pull/16274
    • @peskaf made their first contribution in https://github.com/keras-team/keras/pull/16364
    • @Haaris-Rahman made their first contribution in https://github.com/keras-team/keras/pull/16413
    • @hctomkins made their first contribution in https://github.com/keras-team/keras/pull/16402
    • @itmo153277 made their first contribution in https://github.com/keras-team/keras/pull/16408
    • @hazemessamm made their first contribution in https://github.com/keras-team/keras/pull/16388
    • @prakashsellathurai made their first contribution in https://github.com/keras-team/keras/pull/16398
    • @markus-hinsche made their first contribution in https://github.com/keras-team/keras/pull/16337
    • @sayakpaul made their first contribution in https://github.com/keras-team/keras/pull/16421
    • @Kiwiakos made their first contribution in https://github.com/keras-team/keras/pull/16521
    • @tilakrayal made their first contribution in https://github.com/keras-team/keras/pull/16460
    • @eltociear made their first contribution in https://github.com/keras-team/keras/pull/16568
    • @szutenberg made their first contribution in https://github.com/keras-team/keras/pull/16537
    • @m-ahmadi made their first contribution in https://github.com/keras-team/keras/pull/16607
    • @luckynozomi made their first contribution in https://github.com/keras-team/keras/pull/16673
    • @Wehzie made their first contribution in https://github.com/keras-team/keras/pull/16557
    • @balvisio made their first contribution in https://github.com/keras-team/keras/pull/16683
    • @weipeilun made their first contribution in https://github.com/keras-team/keras/pull/16499
    • @synandi made their first contribution in https://github.com/keras-team/keras/pull/16693
    • @shkarupa-alex made their first contribution in https://github.com/keras-team/keras/pull/16726
    • @miker2241 made their first contribution in https://github.com/keras-team/keras/pull/16731
    • @asukakenji made their first contribution in https://github.com/keras-team/keras/pull/16751
    • @neoaggelos made their first contribution in https://github.com/keras-team/keras/pull/16746
    • @cBournhonesque made their first contribution in https://github.com/keras-team/keras/pull/16739
    • @ltiao made their first contribution in https://github.com/keras-team/keras/pull/16778
    • @timgates42 made their first contribution in https://github.com/keras-team/keras/pull/16789
    • @cyai made their first contribution in https://github.com/keras-team/keras/pull/16799
    • @ianstenbit made their first contribution in https://github.com/keras-team/keras/pull/16818
    • @ehrencrona made their first contribution in https://github.com/keras-team/keras/pull/16814
    • @DyeKuu made their first contribution in https://github.com/keras-team/keras/pull/16821
    • @freddy1020 made their first contribution in https://github.com/keras-team/keras/pull/16823
    • @nivasgopi30 made their first contribution in https://github.com/keras-team/keras/pull/16084
    • @tonyrubanraj made their first contribution in https://github.com/keras-team/keras/pull/16805
    • @s22chan made their first contribution in https://github.com/keras-team/keras/pull/16603
    • @adrianjhpc made their first contribution in https://github.com/keras-team/keras/pull/16877
    • @edumucelli made their first contribution in https://github.com/keras-team/keras/pull/16872
    • @kretes made their first contribution in https://github.com/keras-team/keras/pull/16664
    • @matangover made their first contribution in https://github.com/keras-team/keras/pull/16893
    • @maldil made their first contribution in https://github.com/keras-team/keras/pull/16874
    • @Anselmoo made their first contribution in https://github.com/keras-team/keras/pull/16937
    • @Pouyanpi made their first contribution in https://github.com/keras-team/keras/pull/16989
    • @edwardyehuang made their first contribution in https://github.com/keras-team/keras/pull/17000
    • @JaimeArboleda made their first contribution in https://github.com/keras-team/keras/pull/16870
    • @beyarkay made their first contribution in https://github.com/keras-team/keras/pull/17025
    • @mohantym made their first contribution in https://github.com/keras-team/keras/pull/17038
    • @sashashura made their first contribution in https://github.com/keras-team/keras/pull/17050
    • @Vincent-SV made their first contribution in https://github.com/keras-team/keras/pull/17054
    • @rhelmeczi made their first contribution in https://github.com/keras-team/keras/pull/17081
    • @pitmonticone made their first contribution in https://github.com/keras-team/keras/pull/17096
    • @inonbe made their first contribution in https://github.com/keras-team/keras/pull/17022
    • @myaaaaaaaaa made their first contribution in https://github.com/keras-team/keras/pull/17065
    • @boneyag made their first contribution in https://github.com/keras-team/keras/pull/17119
    • @shanejohnpaul made their first contribution in https://github.com/keras-team/keras/pull/17068

    Full Changelog: https://github.com/keras-team/keras/compare/v2.10.0...v2.11.0-rc1

    Source code(tar.gz)
    Source code(zip)
  • v2.10.0(Sep 2, 2022)

    Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.10.0 for more details.

    Full Changelog: https://github.com/keras-team/keras/compare/v2.9.0...v2.10.0

    Source code(tar.gz)
    Source code(zip)
  • v2.10.0-rc1(Sep 2, 2022)

    Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.10.0-rc3 for more details.

    What's Changed

    • Fix TypeError positional argument when LossScalerOptimizer is used conjointly with tfa wrappers by @lucasdavid in https://github.com/keras-team/keras/pull/16332
    • Add type check to axis by @sachinprasadhs in https://github.com/keras-team/keras/pull/16208
    • minor documention fix by @bmatschke in https://github.com/keras-team/keras/pull/16331
    • Fix typos in data_adapter.py by @taegeonum in https://github.com/keras-team/keras/pull/16326
    • Add exclude_from_weight_decay to AdamW by @markub3327 in https://github.com/keras-team/keras/pull/16274
    • Switching learning/brain dependency to OSS compatible test_util by @copybara-service in https://github.com/keras-team/keras/pull/16362
    • Typo fix in LSTM docstring by @peskaf in https://github.com/keras-team/keras/pull/16364
    • Copy loss and metric to prevent side effect by @drauh in https://github.com/keras-team/keras/pull/16360
    • Denormalization layer by @markub3327 in https://github.com/keras-team/keras/pull/16350
    • Fix reset_states not working when invoked within a tf.function in graph mode. by @copybara-service in https://github.com/keras-team/keras/pull/16400
    • Reduce the complexity of the base layer by pulling out the logic related to handling call function args to a separate class. by @copybara-service in https://github.com/keras-team/keras/pull/16375
    • Add subset="both" functionality to {image|text}_dataset_from_directory() by @Haaris-Rahman in https://github.com/keras-team/keras/pull/16413
    • Fix non-float32 efficientnet calls by @hctomkins in https://github.com/keras-team/keras/pull/16402
    • Fix prediction with structured output by @itmo153277 in https://github.com/keras-team/keras/pull/16408
    • Add reference to resource variables. by @sachinprasadhs in https://github.com/keras-team/keras/pull/16409
    • added audio_dataset.py by @hazemessamm in https://github.com/keras-team/keras/pull/16388
    • Fix Syntax error for combined_model.compile of WideDeepModel by @gadagashwini in https://github.com/keras-team/keras/pull/16447
    • Missing f prefix on f-strings fix by @code-review-doctor in https://github.com/keras-team/keras/pull/16459
    • Update CONTRIBUTING.md by @rthadur in https://github.com/keras-team/keras/pull/15998
    • adds split_dataset utility by @prakashsellathurai in https://github.com/keras-team/keras/pull/16398
    • Support increasing batch size by @markus-hinsche in https://github.com/keras-team/keras/pull/16337
    • Add ConvNeXt models by @sayakpaul in https://github.com/keras-team/keras/pull/16421
    • Fix OrthogonalRegularizer to implement the (1,1) matrix norm by @Kiwiakos in https://github.com/keras-team/keras/pull/16521
    • fix: weight keys so that imagenet init works by @sayakpaul in https://github.com/keras-team/keras/pull/16528
    • Preprocess input correction by @AdityaKane2001 in https://github.com/keras-team/keras/pull/16527
    • Fix typo in documentation by @sushreebarsa in https://github.com/keras-team/keras/pull/16534
    • Update index_lookup.py by @tilakrayal in https://github.com/keras-team/keras/pull/16460
    • update codespaces bazel install by @haifeng-jin in https://github.com/keras-team/keras/pull/16575
    • reduce too long lines in engine/ by @haifeng-jin in https://github.com/keras-team/keras/pull/16579
    • Fix typos by @eltociear in https://github.com/keras-team/keras/pull/16568
    • Fix mixed precision serialization of group convs by @lgeiger in https://github.com/keras-team/keras/pull/16571
    • reduce layers line-too-long by @haifeng-jin in https://github.com/keras-team/keras/pull/16580
    • resolve line-too-long in root directory by @haifeng-jin in https://github.com/keras-team/keras/pull/16584
    • resolve line-too-long in metrics by @haifeng-jin in https://github.com/keras-team/keras/pull/16586
    • resolve line-too-long in optimizers by @haifeng-jin in https://github.com/keras-team/keras/pull/16587
    • resolve line-too-long in distribute by @haifeng-jin in https://github.com/keras-team/keras/pull/16594
    • resolve line-too-long in integration_test by @haifeng-jin in https://github.com/keras-team/keras/pull/16599
    • resovle line-too-long in legacy-tf-layers by @haifeng-jin in https://github.com/keras-team/keras/pull/16600
    • resolve line-too-long in initializers by @haifeng-jin in https://github.com/keras-team/keras/pull/16598
    • resolve line-too-long in api by @haifeng-jin in https://github.com/keras-team/keras/pull/16592
    • resolve line-too-long in benchmarks by @haifeng-jin in https://github.com/keras-team/keras/pull/16593
    • resolve line-too-long in feature_column by @haifeng-jin in https://github.com/keras-team/keras/pull/16597
    • resolve line-too-long in datasets by @haifeng-jin in https://github.com/keras-team/keras/pull/16591
    • resolve line-too-long in dtensor by @haifeng-jin in https://github.com/keras-team/keras/pull/16595
    • resolve line-too-long in estimator by @haifeng-jin in https://github.com/keras-team/keras/pull/16596
    • resolve line-too-long in applications by @haifeng-jin in https://github.com/keras-team/keras/pull/16590
    • resolve line-too-long in mixed_precision by @haifeng-jin in https://github.com/keras-team/keras/pull/16605
    • resolve line-too-long in models by @haifeng-jin in https://github.com/keras-team/keras/pull/16606
    • resolve line-too-long in premade_models by @haifeng-jin in https://github.com/keras-team/keras/pull/16608
    • resolve line-too-long in tests by @haifeng-jin in https://github.com/keras-team/keras/pull/16613
    • resolve line-too-long in testing_infra by @haifeng-jin in https://github.com/keras-team/keras/pull/16612
    • resolve line-too-long in saving by @haifeng-jin in https://github.com/keras-team/keras/pull/16611
    • resolve line-too-long in preprocessing by @haifeng-jin in https://github.com/keras-team/keras/pull/16609
    • resolve line-too-long in utils by @haifeng-jin in https://github.com/keras-team/keras/pull/16614
    • Optimize L2 Regularizer (use tf.nn.l2_loss) by @szutenberg in https://github.com/keras-team/keras/pull/16537
    • let the linter ignore certain lines, prepare to enforce line length by @haifeng-jin in https://github.com/keras-team/keras/pull/16617
    • Fix typo by @m-ahmadi in https://github.com/keras-team/keras/pull/16607
    • Explicitely set AutoShardPolicy.DATA for TensorLike datasets by @lgeiger in https://github.com/keras-team/keras/pull/16604
    • Fix all flake8 errors by @haifeng-jin in https://github.com/keras-team/keras/pull/16621
    • Update lint.yml by @haifeng-jin in https://github.com/keras-team/keras/pull/16648
    • Fix typo error of tf.compat.v1.keras.experimental for export and load model by @gadagashwini in https://github.com/keras-team/keras/pull/16636
    • Fix documentation in keras.datasets.imdb by @luckynozomi in https://github.com/keras-team/keras/pull/16673
    • Update init.py by @Wehzie in https://github.com/keras-team/keras/pull/16557
    • Fix documentation in keras.layers.attention.multi_head_attention by @balvisio in https://github.com/keras-team/keras/pull/16683
    • Fix missed parameter from AUC config by @weipeilun in https://github.com/keras-team/keras/pull/16499
    • Fix bug for KerasTensor._keras_mask should be None by @haifeng-jin in https://github.com/keras-team/keras/pull/16689
    • Fixed some spellings by @synandi in https://github.com/keras-team/keras/pull/16693
    • Fix batchnorm momentum in ResNetRS by @shkarupa-alex in https://github.com/keras-team/keras/pull/16726
    • Add variable definitions in optimizer usage example by @miker2241 in https://github.com/keras-team/keras/pull/16731
    • Fixed issue #16749 by @asukakenji in https://github.com/keras-team/keras/pull/16751
    • Fix usage of deprecated Pillow interpolation methods by @neoaggelos in https://github.com/keras-team/keras/pull/16746
    • :memo: Add typing to some callback classes by @gabrieldemarmiesse in https://github.com/keras-team/keras/pull/16692
    • Add support for Keras mask & causal mask to MultiHeadAttention by @ageron in https://github.com/keras-team/keras/pull/16619
    • Update standard name by @chunduriv in https://github.com/keras-team/keras/pull/16772
    • Fix error when labels contains brackets when plotting model by @cBournhonesque in https://github.com/keras-team/keras/pull/16739
    • Fixing the incorrect link in input_layer.py by @tilakrayal in https://github.com/keras-team/keras/pull/16767
    • Formatted callback.py to render correctly by @jvishnuvardhan in https://github.com/keras-team/keras/pull/16765
    • Fixed typo in docs by @ltiao in https://github.com/keras-team/keras/pull/16778
    • docs: Fix a few typos by @timgates42 in https://github.com/keras-team/keras/pull/16789
    • Add ignore_class to sparse crossentropy and IoU by @lucasdavid in https://github.com/keras-team/keras/pull/16712
    • Updated f-string method by @cyai in https://github.com/keras-team/keras/pull/16799
    • Fix NASNet input shape computation by @ianstenbit in https://github.com/keras-team/keras/pull/16818
    • Fix incorrect ref. to learning_rate_schedule during module import by @lucasdavid in https://github.com/keras-team/keras/pull/16813
    • Fixing the incorrect link in backend.py by @tilakrayal in https://github.com/keras-team/keras/pull/16806
    • Corrected DepthwiseConv1D docstring by @AdityaKane2001 in https://github.com/keras-team/keras/pull/16807
    • Typo and grammar: "recieved" by @ehrencrona in https://github.com/keras-team/keras/pull/16814
    • Fix typo in doc by @DyeKuu in https://github.com/keras-team/keras/pull/16821
    • Update README.md by @freddy1020 in https://github.com/keras-team/keras/pull/16823
    • Updated f-string method by @cyai in https://github.com/keras-team/keras/pull/16775
    • Add is_legacy_optimizer to optimizer config to keep saving/loading consistent. by @copybara-service in https://github.com/keras-team/keras/pull/16842
    • Add is_legacy_optimizer to optimizer config to keep saving/loading … by @qlzh727 in https://github.com/keras-team/keras/pull/16856

    New Contributors

    • @bmatschke made their first contribution in https://github.com/keras-team/keras/pull/16331
    • @taegeonum made their first contribution in https://github.com/keras-team/keras/pull/16326
    • @markub3327 made their first contribution in https://github.com/keras-team/keras/pull/16274
    • @peskaf made their first contribution in https://github.com/keras-team/keras/pull/16364
    • @Haaris-Rahman made their first contribution in https://github.com/keras-team/keras/pull/16413
    • @hctomkins made their first contribution in https://github.com/keras-team/keras/pull/16402
    • @itmo153277 made their first contribution in https://github.com/keras-team/keras/pull/16408
    • @hazemessamm made their first contribution in https://github.com/keras-team/keras/pull/16388
    • @prakashsellathurai made their first contribution in https://github.com/keras-team/keras/pull/16398
    • @markus-hinsche made their first contribution in https://github.com/keras-team/keras/pull/16337
    • @sayakpaul made their first contribution in https://github.com/keras-team/keras/pull/16421
    • @Kiwiakos made their first contribution in https://github.com/keras-team/keras/pull/16521
    • @sushreebarsa made their first contribution in https://github.com/keras-team/keras/pull/16534
    • @tilakrayal made their first contribution in https://github.com/keras-team/keras/pull/16460
    • @eltociear made their first contribution in https://github.com/keras-team/keras/pull/16568
    • @szutenberg made their first contribution in https://github.com/keras-team/keras/pull/16537
    • @m-ahmadi made their first contribution in https://github.com/keras-team/keras/pull/16607
    • @luckynozomi made their first contribution in https://github.com/keras-team/keras/pull/16673
    • @Wehzie made their first contribution in https://github.com/keras-team/keras/pull/16557
    • @balvisio made their first contribution in https://github.com/keras-team/keras/pull/16683
    • @weipeilun made their first contribution in https://github.com/keras-team/keras/pull/16499
    • @synandi made their first contribution in https://github.com/keras-team/keras/pull/16693
    • @shkarupa-alex made their first contribution in https://github.com/keras-team/keras/pull/16726
    • @miker2241 made their first contribution in https://github.com/keras-team/keras/pull/16731
    • @asukakenji made their first contribution in https://github.com/keras-team/keras/pull/16751
    • @neoaggelos made their first contribution in https://github.com/keras-team/keras/pull/16746
    • @cBournhonesque made their first contribution in https://github.com/keras-team/keras/pull/16739
    • @ltiao made their first contribution in https://github.com/keras-team/keras/pull/16778
    • @timgates42 made their first contribution in https://github.com/keras-team/keras/pull/16789
    • @ianstenbit made their first contribution in https://github.com/keras-team/keras/pull/16818
    • @ehrencrona made their first contribution in https://github.com/keras-team/keras/pull/16814
    • @DyeKuu made their first contribution in https://github.com/keras-team/keras/pull/16821
    • @freddy1020 made their first contribution in https://github.com/keras-team/keras/pull/16823

    Full Changelog: https://github.com/keras-team/keras/compare/v2.9.0-rc0...v2.10.0-rc1

    Source code(tar.gz)
    Source code(zip)
  • v2.9.0(May 13, 2022)

    Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.9.0 for more details.

    Full Changelog: https://github.com/keras-team/keras/compare/v2.8.0...v2.9.0

    Source code(tar.gz)
    Source code(zip)
  • v2.9.0-rc2(Apr 22, 2022)

    What's Changed

    • Cherrypick DTensor docstring fix for 2.9 release. by @qlzh727 in https://github.com/keras-team/keras/pull/16434
    • Cherrypick for RandomContrast update by @qlzh727 in https://github.com/keras-team/keras/pull/16435
    • Cherrypick ImageAugmetation related change to R2.9 by @qlzh727 in https://github.com/keras-team/keras/pull/16454

    Full Changelog: https://github.com/keras-team/keras/compare/v2.9.0-rc1...v2.9.0-rc2

    Source code(tar.gz)
    Source code(zip)
  • v2.9.0-rc1(Apr 18, 2022)

    What's Changed

    • Cherrypick Keras DTensor related updates into keras 2.9 by @qlzh727 in https://github.com/keras-team/keras/pull/16379

    Full Changelog: https://github.com/keras-team/keras/compare/v2.9.0-rc0...v2.9.0-rc1

    Source code(tar.gz)
    Source code(zip)
  • v2.9.0-rc0(Apr 4, 2022)

    Please see https://github.com/tensorflow/tensorflow/blob/r2.9/RELEASE.md for Keras release notes.

    Major Features and Improvements

    • tf.keras:
      • Added tf.keras.applications.resnet_rs models. This includes the ResNetRS50, ResNetRS101, ResNetRS152, ResNetRS200, ResNetRS270, ResNetRS350 and ResNetRS420 model architectures. The ResNetRS models are based on the architecture described in Revisiting ResNets: Improved Training and Scaling Strategies
      • Added tf.keras.optimizers.experimental.Optimizer. The reworked optimizer gives more control over different phases of optimizer calls, and is easier to customize. We provide Adam, SGD, Adadelta, AdaGrad and RMSprop optimizers based on tf.keras.optimizers.experimental.Optimizer. Generally the new optimizers work in the same way as the old ones, but support new constructor arguments. In the future, the symbols tf.keras.optimizers.Optimizer/Adam/etc will point to the new optimizers, and the previous generation of optimizers will be moved to tf.keras.optimizers.legacy.Optimizer/Adam/etc.
      • Added L2 unit normalization layer tf.keras.layers.UnitNormalization.
      • Added tf.keras.regularizers.OrthogonalRegularizer, a new regularizer that encourages orthogonality between the rows (or columns) or a weight matrix.
      • Added tf.keras.layers.RandomBrightness layer for image preprocessing.
      • Added APIs for switching between interactive logging and absl logging. By default, Keras always writes the logs to stdout. However, this is not optimal in a non-interactive environment, where you don't have access to stdout, but can only view the logs. You can use tf.keras.utils.disable_interactive_logging() to write the logs to ABSL logging. You can also use tf.keras.utils.enable_interactive_logging() to change it back to stdout, or tf.keras.utils.is_interactive_logging_enabled() to check if interactive logging is enabled.
      • Changed default value for the verbose argument of Model.evaluate() and Model.predict() to "auto", which defaults to verbose=1 for most cases and defaults to verbose=2 when used with ParameterServerStrategy or with interactive logging disabled.
      • Argument jit_compile in Model.compile() now applies to Model.evaluate() and Model.predict(). Setting jit_compile=True in compile() compiles the model's training, evaluation, and inference steps to XLA. Note that jit_compile=True may not necessarily work for all models.
      • Added DTensor-related Keras APIs under tf.keras.dtensor namespace. The APIs are still classified as experimental. You are welcome to try it out. Please check the tutoral and guide on https://www.tensorflow.org/ for more details about DTensor.

    What's Changed

    • Update_OptimizerV2.py by @sachinprasadhs in https://github.com/keras-team/keras/pull/15819
    • Use assign_sub when computing moving_average_update by @lgeiger in https://github.com/keras-team/keras/pull/15773
    • Document the verbose parameter in EarlyStopping by @ThunderKey in https://github.com/keras-team/keras/pull/15817
    • Fix LSTM and GRU cuDNN kernel failure for RaggedTensors. by @foxik in https://github.com/keras-team/keras/pull/15756
    • A tiny problem in an AttributeError message in base_layer.py by @Aujkst in https://github.com/keras-team/keras/pull/15847
    • Update training_generator_test.py by @sachinprasadhs in https://github.com/keras-team/keras/pull/15876
    • Minor correction in RegNet docs by @AdityaKane2001 in https://github.com/keras-team/keras/pull/15901
    • add scoring methods in Luong-style attention by @old-school-kid in https://github.com/keras-team/keras/pull/15867
    • refactoring code with List Comprehension by @idiomaticrefactoring in https://github.com/keras-team/keras/pull/15924
    • added clarifying statement to save_model example text by @soosung80 in https://github.com/keras-team/keras/pull/15930
    • Update base_conv.py by @AdityaKane2001 in https://github.com/keras-team/keras/pull/15943
    • Update global_clipnorm by @sachinprasadhs in https://github.com/keras-team/keras/pull/15938
    • Update callbacks.py by @Cheril311 in https://github.com/keras-team/keras/pull/15977
    • Applied correct reshaping to metric func sparse_top_k by @dfossl in https://github.com/keras-team/keras/pull/15997
    • Keras saving/loading: Add a custom object saving test to verify the keras.utils.register_keras_serializable flows we are expecting users to follow work, and will continue to work with the new design and implementation coming in. by @copybara-service in https://github.com/keras-team/keras/pull/15992
    • Metric accuracy bug fixes - Metrics Refactor proposal by @dfossl in https://github.com/keras-team/keras/pull/16010
    • Make classifier_activation argument accessible for DenseNet and NASNet models by @adrhill in https://github.com/keras-team/keras/pull/16005
    • Copy image utils from keras_preprocessing directly into core keras by @copybara-service in https://github.com/keras-team/keras/pull/15975
    • Update keras.callbacks.BackupAndRestore docs by @lgeiger in https://github.com/keras-team/keras/pull/16018
    • Updating the definition of an argument in the text_dataset_from_directory function by @shraddhazpy in https://github.com/keras-team/keras/pull/16012
    • Remove deprecated TF1 Layer APIs apply(), get_updates_for(), get_losses_for(), and remove the inputs argument in the add_loss() method. by @copybara-service in https://github.com/keras-team/keras/pull/16046
    • Fixed minor typos by @hdubbs in https://github.com/keras-team/keras/pull/16071
    • Fix typo in documentation by @futtetennista in https://github.com/keras-team/keras/pull/16082
    • Issue #16090: Split input_shapes horizontally in utils.vis_utils.plot_model by @RicardFos in https://github.com/keras-team/keras/pull/16096
    • Docker env setup related changes by @shraddhazpy in https://github.com/keras-team/keras/pull/16040
    • Fixed EfficientNetV2 b parameter not increasing with each block. by @sebastian-sz in https://github.com/keras-team/keras/pull/16145
    • Updated args of train_on_batch method by @jvishnuvardhan in https://github.com/keras-team/keras/pull/16147
    • Binary accuracy bug fixes - Metric accuracy method refactor by @dfossl in https://github.com/keras-team/keras/pull/16083
    • Fix the corner case for dtensor model layout map. by @copybara-service in https://github.com/keras-team/keras/pull/16170
    • Fix typo in docstring for DenseFeatures by @gadagashwini in https://github.com/keras-team/keras/pull/16165
    • Fix typo in Returns Section by @chunduriv in https://github.com/keras-team/keras/pull/16182
    • Some tests misusing assertTrue for comparisons fix by @code-review-doctor in https://github.com/keras-team/keras/pull/16073
    • Add .DS_Store to .gitignore for macOS users by @tsheaff in https://github.com/keras-team/keras/pull/16198
    • Solve memory inefficiency in RNNs by @atmguille in https://github.com/keras-team/keras/pull/16174
    • Update README.md by @ahmedopolis in https://github.com/keras-team/keras/pull/16259
    • Fix documentation text being mistakenly rendered as code by @guberti in https://github.com/keras-team/keras/pull/16253
    • Allow single input for merging layers Add, Average, Concatenate, Maximum, Minimum, Multiply by @foxik in https://github.com/keras-team/keras/pull/16230
    • Mention image dimensions format in image_dataset_from_directory by @nrzimmermann in https://github.com/keras-team/keras/pull/16232
    • fix thresholded_relu to support list datatype by @old-school-kid in https://github.com/keras-team/keras/pull/16277
    • Implement all tf interpolation upscaling methods by @Mahrkeenerh in https://github.com/keras-team/keras/pull/16249

    New Contributors

    • @lgeiger made their first contribution in https://github.com/keras-team/keras/pull/15773
    • @ThunderKey made their first contribution in https://github.com/keras-team/keras/pull/15817
    • @Aujkst made their first contribution in https://github.com/keras-team/keras/pull/15847
    • @idiomaticrefactoring made their first contribution in https://github.com/keras-team/keras/pull/15924
    • @soosung80 made their first contribution in https://github.com/keras-team/keras/pull/15930
    • @Cheril311 made their first contribution in https://github.com/keras-team/keras/pull/15977
    • @dfossl made their first contribution in https://github.com/keras-team/keras/pull/15997
    • @adrhill made their first contribution in https://github.com/keras-team/keras/pull/16005
    • @shraddhazpy made their first contribution in https://github.com/keras-team/keras/pull/16012
    • @hdubbs made their first contribution in https://github.com/keras-team/keras/pull/16071
    • @futtetennista made their first contribution in https://github.com/keras-team/keras/pull/16082
    • @RicardFos made their first contribution in https://github.com/keras-team/keras/pull/16096
    • @gadagashwini made their first contribution in https://github.com/keras-team/keras/pull/16165
    • @chunduriv made their first contribution in https://github.com/keras-team/keras/pull/16182
    • @code-review-doctor made their first contribution in https://github.com/keras-team/keras/pull/16073
    • @tsheaff made their first contribution in https://github.com/keras-team/keras/pull/16198
    • @atmguille made their first contribution in https://github.com/keras-team/keras/pull/16174
    • @ahmedopolis made their first contribution in https://github.com/keras-team/keras/pull/16259
    • @guberti made their first contribution in https://github.com/keras-team/keras/pull/16253
    • @nrzimmermann made their first contribution in https://github.com/keras-team/keras/pull/16232
    • @Mahrkeenerh made their first contribution in https://github.com/keras-team/keras/pull/16249

    Full Changelog: https://github.com/keras-team/keras/compare/v2.8.0-rc0...v2.9.0-rc0

    Source code(tar.gz)
    Source code(zip)
  • v2.8.0(Feb 3, 2022)

  • v2.8.0-rc1(Jan 18, 2022)

    What's Changed

    • Compute LSTM and GRU via cuDNN for RaggedTensors. by @foxik in https://github.com/keras-team/keras/pull/15862

    Full Changelog: https://github.com/keras-team/keras/compare/v2.8.0-rc0...v2.8.0-rc1

    Source code(tar.gz)
    Source code(zip)
  • v2.8.0-rc0(Dec 22, 2021)

    Please see https://github.com/tensorflow/tensorflow/blob/r2.8/RELEASE.md for Keras release notes.

    • tf.keras:
      • Preprocessing Layers
        • Added a tf.keras.layers.experimental.preprocessing.HashedCrossing layer which applies the hashing trick to the concatenation of crossed scalar inputs. This provides a stateless way to try adding feature crosses of integer or string data to a model.
        • Removed keras.layers.experimental.preprocessing.CategoryCrossing. Users should migrate to the HashedCrossing layer or use tf.sparse.cross/tf.ragged.cross directly.
        • Added additional standardize and split modes to TextVectorization.
          • standardize="lower" will lowercase inputs.
          • standardize="string_punctuation" will remove all puncuation.
          • split="character" will split on every unicode character.
        • Added an output_mode argument to the Discretization and Hashing layers with the same semantics as other preprocessing layers. All categorical preprocessing layers now support output_mode.
        • All preprocessing layer output will follow the compute dtype of a tf.keras.mixed_precision.Policy, unless constructed with output_mode="int" in which case output will be tf.int64. The output type of any preprocessing layer can be controlled individually by passing a dtype argument to the layer.
      • tf.random.Generator for keras initializers and all RNG code.
        • Added 3 new APIs for enable/disable/check the usage of tf.random.Generator in keras backend, which will be the new backend for all the RNG in Keras. We plan to switch on the new code path by default in tf 2.8, and the behavior change will likely to cause some breakage on user side (eg if the test is checking against some golden nubmer). These 3 APIs will allow user to disable and switch back to legacy behavior if they prefer. In future (eg tf 2.10), we expect to totally remove the legacy code path (stateful random Ops), and these 3 APIs will be removed as well.
      • tf.keras.callbacks.experimental.BackupAndRestore is now available as tf.keras.callbacks.BackupAndRestore. The experimental endpoint is deprecated and will be removed in a future release.
      • tf.keras.experimental.SidecarEvaluator is now available as tf.keras.utils.SidecarEvaluator. The experimental endpoint is deprecated and will be removed in a future release.
      • Metrics update and collection logic in default Model.train_step() is now customizable via overriding Model.compute_metrics().
      • Losses computation logic in default Model.train_step() is now customizable via overriding Model.compute_loss().
      • jit_compile added to Model.compile() on an opt-in basis to compile the model's training step with XLA. Note that jit_compile=True may not necessarily work for all models.

    What's Changed

    • Cleanup legacy Keras files by @qlzh727 in https://github.com/keras-team/keras/pull/14256
    • Sync OSS keras to head. by @qlzh727 in https://github.com/keras-team/keras/pull/14300
    • Update build script for GPU build. by @copybara-service in https://github.com/keras-team/keras/pull/14336
    • Move the LossReduction class from tf to Keras. by @copybara-service in https://github.com/keras-team/keras/pull/14362
    • Update keras API generate script. by @copybara-service in https://github.com/keras-team/keras/pull/14418
    • Adding extra target that are needed by PIP package dependency. by @copybara-service in https://github.com/keras-team/keras/pull/14421
    • Add test related targets to PIP package list. by @copybara-service in https://github.com/keras-team/keras/pull/14427
    • Sync OSS keras to head. by @copybara-service in https://github.com/keras-team/keras/pull/14428
    • Update visibility setting for keras/tests to enable PIP package testing. by @copybara-service in https://github.com/keras-team/keras/pull/14429
    • Remove items from PIP_EXCLUDED_FILES which is needed with testing PIP. by @copybara-service in https://github.com/keras-team/keras/pull/14431
    • Split bins into num_bins and bin_boundaries arguments for discretization by @copybara-service in https://github.com/keras-team/keras/pull/14507
    • Update pbtxt to use _PRFER_OSS_KERAS=1. by @copybara-service in https://github.com/keras-team/keras/pull/14519
    • Sync OSS keras to head. by @copybara-service in https://github.com/keras-team/keras/pull/14572
    • Sync OSS keras to head. by @copybara-service in https://github.com/keras-team/keras/pull/14614
    • Cleanup the bazelrc and remove unrelated items to keras. by @copybara-service in https://github.com/keras-team/keras/pull/14616
    • Sync OSS keras to head. by @copybara-service in https://github.com/keras-team/keras/pull/14624
    • Remove object metadata when saving SavedModel. by @copybara-service in https://github.com/keras-team/keras/pull/14697
    • Fix static shape inference for Resizing layer. by @copybara-service in https://github.com/keras-team/keras/pull/14712
    • Make TextVectorization work with list input. by @copybara-service in https://github.com/keras-team/keras/pull/14711
    • Remove deprecated methods of Sequential model. by @copybara-service in https://github.com/keras-team/keras/pull/14714
    • Improve Model docstrings by @copybara-service in https://github.com/keras-team/keras/pull/14726
    • Add migration doc for legacy_tf_layers/core.py. by @copybara-service in https://github.com/keras-team/keras/pull/14740
    • PR #43417: Fixes #42872: map_to_outputs_names always returns a copy by @copybara-service in https://github.com/keras-team/keras/pull/14755
    • Rename the keras.py to keras_lib.py to resolve the name conflict during OSS test. by @copybara-service in https://github.com/keras-team/keras/pull/14778
    • Switch to tf.io.gfile for validating vocabulary files. by @copybara-service in https://github.com/keras-team/keras/pull/14788
    • Avoid serializing generated thresholds for AUC metrics. by @copybara-service in https://github.com/keras-team/keras/pull/14789
    • Fix data_utils.py when name ends with .tar.gz by @copybara-service in https://github.com/keras-team/keras/pull/14777
    • Fix lookup layer oov token check when num_oov_indices > len(vocabulary tokens) by @copybara-service in https://github.com/keras-team/keras/pull/14793
    • Update callbacks.py by @jvishnuvardhan in https://github.com/keras-team/keras/pull/14760
    • Fix keras metric.result_state when the metric variables are sharded variable. by @copybara-service in https://github.com/keras-team/keras/pull/14790
    • Fix typos in CONTRIBUTING.md by @amogh7joshi in https://github.com/keras-team/keras/pull/14642
    • Fixed ragged sample weights by @DavideWalder in https://github.com/keras-team/keras/pull/14804
    • Pin the protobuf version to 3.9.2 which is same as the TF. by @copybara-service in https://github.com/keras-team/keras/pull/14835
    • Make variable scope shim regularizer adding check for attribute presence instead of instance class by @copybara-service in https://github.com/keras-team/keras/pull/14837
    • Add missing license header for leakr check. by @copybara-service in https://github.com/keras-team/keras/pull/14840
    • Fix TextVectorization with output_sequence_length on unknown input shapes by @copybara-service in https://github.com/keras-team/keras/pull/14832
    • Add more explicit error message for instance type checking of optimizer. by @copybara-service in https://github.com/keras-team/keras/pull/14846
    • Set aggregation for variable when using PS Strategy for aggregating variables when running multi-gpu tests. by @copybara-service in https://github.com/keras-team/keras/pull/14845
    • Remove unnecessary reshape layer in MobileNet architecture by @copybara-service in https://github.com/keras-team/keras/pull/14854
    • Removes caching of the convolution tf.nn.convolution op. While this provided some performance benefits, it also produced some surprising behavior for users in eager mode. by @copybara-service in https://github.com/keras-team/keras/pull/14855
    • Output int64 by default from Discretization by @copybara-service in https://github.com/keras-team/keras/pull/14841
    • add patterns to .gitignore by @haifeng-jin in https://github.com/keras-team/keras/pull/14861
    • Clarify documentation of DepthwiseConv2D by @vinhill in https://github.com/keras-team/keras/pull/14817
    • add DepthwiseConv1D layer by @fsx950223 in https://github.com/keras-team/keras/pull/14863
    • Make model summary wrap by @Llamrei in https://github.com/keras-team/keras/pull/14865
    • Update the link in Estimator by @hirobf10 in https://github.com/keras-team/keras/pull/14901
    • Fix int given for float args by @SamuelMarks in https://github.com/keras-team/keras/pull/14900
    • Fix RNN, StackedRNNCells with nested state_size, output_size TypeError issues by @Ending2015a in https://github.com/keras-team/keras/pull/14905
    • Fix the use of imagenet_utils.preprocess_input within a Lambda layer with mixed precision by @anth2o in https://github.com/keras-team/keras/pull/14917
    • Fix docstrings in MultiHeadAttention layer call argument return_attention_scores. by @guillesanbri in https://github.com/keras-team/keras/pull/14920
    • Check if layer has _metrics_lock attribute by @DanBmh in https://github.com/keras-team/keras/pull/14903
    • Make keras.Model picklable by @adriangb in https://github.com/keras-team/keras/pull/14748
    • Fix typo in docs by @seanmor5 in https://github.com/keras-team/keras/pull/14946
    • use getter setter by @fsx950223 in https://github.com/keras-team/keras/pull/14948
    • Close _SESSION.session in clear_session by @sfreilich in https://github.com/keras-team/keras/pull/14414
    • Fix keras nightly PIP package build. by @copybara-service in https://github.com/keras-team/keras/pull/14957
    • Fix EarlyStopping stop at fisrt epoch when patience=0 ; add auc to au… by @DachuanZhao in https://github.com/keras-team/keras/pull/14750
    • Add default value in Attention layer docs #50839 by @europeanplaice in https://github.com/keras-team/keras/pull/14952
    • Update 00-bug-template.md by @jvishnuvardhan in https://github.com/keras-team/keras/pull/14991
    • minor fixing by @slowy07 in https://github.com/keras-team/keras/pull/15008
    • Remove cast of y_true to y_pred data type in sparse categorical cross entropy loss by @old-school-kid in https://github.com/keras-team/keras/pull/15015
    • Improve a number of error messages in Keras layers. by @copybara-service in https://github.com/keras-team/keras/pull/15031
    • Fix typo in the test case name. by @copybara-service in https://github.com/keras-team/keras/pull/15050
    • BackupAndRestore callback: Allow the train_counter to be fault tolerant across training interruptions. by @copybara-service in https://github.com/keras-team/keras/pull/15018
    • Include Keras API design guidelines in the contribution docs. by @copybara-service in https://github.com/keras-team/keras/pull/15051
    • Fix clone_model to consider input_tensors by @LeonhardFeiner in https://github.com/keras-team/keras/pull/14982
    • Fix docs about GRU and cuDNN. by @bzamecnik in https://github.com/keras-team/keras/pull/15058
    • fix: typo spelling by @slowy07 in https://github.com/keras-team/keras/pull/14989
    • update contributing guide by @haifeng-jin in https://github.com/keras-team/keras/pull/15063
    • Make python code in Sequential docs consistent by @01-vyom in https://github.com/keras-team/keras/pull/15075
    • Create stale.yml by @rthadur in https://github.com/keras-team/keras/pull/15176
    • Update Contributing Guide by @haifeng-jin in https://github.com/keras-team/keras/pull/15133
    • fix "rbg" -> "rgb" in image_dataset_from_directory by @YoniChechik in https://github.com/keras-team/keras/pull/15177
    • Do not initialize tables automatically for lookup layers by @copybara-service in https://github.com/keras-team/keras/pull/15193
    • Log the best epoch when restoring the best weights in early stopping by @harupy in https://github.com/keras-team/keras/pull/15197
    • update contributing guide by @haifeng-jin in https://github.com/keras-team/keras/pull/15189
    • fix array for numpy support by @collinzrj in https://github.com/keras-team/keras/pull/15201
    • Add test case for batch normalization with renorm on TPUs. by @copybara-service in https://github.com/keras-team/keras/pull/15234
    • Update training.py by @jvishnuvardhan in https://github.com/keras-team/keras/pull/15195
    • [Follow-up for #15197] Fix a log message for weight restoration in early stopping by @harupy in https://github.com/keras-team/keras/pull/15222
    • Rename references to "K" as "backend" for consistency. by @copybara-service in https://github.com/keras-team/keras/pull/15242
    • Add Keras utility for making user programs deterministic. by @copybara-service in https://github.com/keras-team/keras/pull/15243
    • Update convolutional.py by @ymodak in https://github.com/keras-team/keras/pull/15158
    • Fix for bug causing failing test keras/utils/vis_utils_test.py test_layer_range_value_fail second value (empty list). by @ddrakard in https://github.com/keras-team/keras/pull/15215
    • Fix small mistake … optimizer to optimizers by @MohamedAliRashad in https://github.com/keras-team/keras/pull/15227
    • Added dense_shape property delegation by @jackd in https://github.com/keras-team/keras/pull/15199
    • handle when a List is used as validation_data instead of a Tuple, in model.fit() by @tarun-bisht in https://github.com/keras-team/keras/pull/15237
    • fix cropping layer return empty list if crop is higher than data shape by @arubiales in https://github.com/keras-team/keras/pull/14970
    • Make the import in integration_test consistent with other keras code. by @copybara-service in https://github.com/keras-team/keras/pull/15275
    • Specify stacklevel for warnings.warn to make it easier to identify which lines throw warnings by @harupy in https://github.com/keras-team/keras/pull/15209
    • Fixes Github tensorflow/issues/51710 by @copybara-service in https://github.com/keras-team/keras/pull/15280
    • Print expanded nested layers feature in models.summary() by @krishrustagi in https://github.com/keras-team/keras/pull/15251
    • adapt EarlyStopping auto mode to auc by @DachuanZhao in https://github.com/keras-team/keras/pull/15200
    • change misleading description of m_mul by @mikael-epigram in https://github.com/keras-team/keras/pull/15288
    • The latest update.Hope it can suit you by @DLPerf in https://github.com/keras-team/keras/pull/15295
    • Fixed and added ValueError for plot_model, model_to_dot and model.summary() by @krishrustagi in https://github.com/keras-team/keras/pull/15318
    • Fix a minor typo in CIFAR-10 and CIFAR-100 description by @Rishit-dagli in https://github.com/keras-team/keras/pull/15321
    • Fix cropping2D empty list #15325 by @arubiales in https://github.com/keras-team/keras/pull/15326
    • convert label_smoothing dtype to y dtype by @FancyXun in https://github.com/keras-team/keras/pull/15363
    • Exclude default bazel paths for VsCode by @bhack in https://github.com/keras-team/keras/pull/15343
    • fix: typo in SeparableConv1D by @carmineds in https://github.com/keras-team/keras/pull/15370
    • Add user bin path for pip installed packages by @bhack in https://github.com/keras-team/keras/pull/15385
    • Fix reset_metrics by @bhack in https://github.com/keras-team/keras/pull/15342
    • Kernel_size, pool_size should be positive integers by @WingsBrokenAngel in https://github.com/keras-team/keras/pull/15356
    • Reopening #48000, #48491, #48610 from tensorflow/tensorflow by @AdityaKane2001 in https://github.com/keras-team/keras/pull/15315
    • expand_nested bug fix and changing model.summary style by @krishrustagi in https://github.com/keras-team/keras/pull/15355
    • unnecessary casting and condition removed by @cemsina in https://github.com/keras-team/keras/pull/15399
    • Bug fix for issue #15211, PR #15233 ("Plot model show activations") by @ddrakard in https://github.com/keras-team/keras/pull/15286
    • fix a bug: when use tf.keras.layers.TextVectorization layer to load model by @mikuh in https://github.com/keras-team/keras/pull/15422
    • added correct initialisation for MHA by @FabianGroeger96 in https://github.com/keras-team/keras/pull/15423
    • Persist attribute "sparse" of IndexLookup layer by @diggerk in https://github.com/keras-team/keras/pull/15473
    • Updated Normalization import by @sachinprasadhs in https://github.com/keras-team/keras/pull/15476
    • Added layer trainable information in model summary by @mfidabel in https://github.com/keras-team/keras/pull/15459
    • Add efficientnet v2 to keras.applications by @sebastian-sz in https://github.com/keras-team/keras/pull/14935
    • Fix typos by @kianmeng in https://github.com/keras-team/keras/pull/15543
    • Update the contribution guide to include a applications section by @mattdangerw in https://github.com/keras-team/keras/pull/15447
    • chore: replace os.path.join with tf.io.gfile.join by @adriangb in https://github.com/keras-team/keras/pull/15551
    • Fixing typos. by @MohamadJaber1 in https://github.com/keras-team/keras/pull/15626
    • Updating the documentation of MAPE by @sanatmpa1 in https://github.com/keras-team/keras/pull/15604
    • Fix typo by @europeanplaice in https://github.com/keras-team/keras/pull/15639
    • [Docs] Changed typo ModelNetV3 to MobileNetV3. by @sebastian-sz in https://github.com/keras-team/keras/pull/15640
    • Adding a choice not to make batches in timeseries_dataset_from_array by @europeanplaice in https://github.com/keras-team/keras/pull/15646
    • Bypass the require a config warning for marge layers by @leondgarse in https://github.com/keras-team/keras/pull/15612
    • Allow keras.utils.Sequence sub-classes to use sparse/ragged tensors by @karlhigley in https://github.com/keras-team/keras/pull/15264
    • fix backend _GRAPH_LEARNING_PHASES graph circular reference. by @zhjunqin in https://github.com/keras-team/keras/pull/15520
    • doc: add link to SciKeras migration guide by @adriangb in https://github.com/keras-team/keras/pull/15723
    • Fix a minor typo in the docstring by @kykim0 in https://github.com/keras-team/keras/pull/15683
    • Fixed docstrings in keras/optimizer_v2/learning_rate_schedule.py by @AdityaKane2001 in https://github.com/keras-team/keras/pull/15718
    • Implement compute_output_shape for BaseDenseAttention by @mishc9 in https://github.com/keras-team/keras/pull/15720
    • SidecarEvaluator: Graduate from experimental endpoint. by @copybara-service in https://github.com/keras-team/keras/pull/15788
    • Update README.md by @aliencaocao in https://github.com/keras-team/keras/pull/15814

    New Contributors

    • @copybara-service made their first contribution in https://github.com/keras-team/keras/pull/14336
    • @jvishnuvardhan made their first contribution in https://github.com/keras-team/keras/pull/14760
    • @amogh7joshi made their first contribution in https://github.com/keras-team/keras/pull/14642
    • @DavideWalder made their first contribution in https://github.com/keras-team/keras/pull/14804
    • @vinhill made their first contribution in https://github.com/keras-team/keras/pull/14817
    • @fsx950223 made their first contribution in https://github.com/keras-team/keras/pull/14863
    • @Llamrei made their first contribution in https://github.com/keras-team/keras/pull/14865
    • @hirobf10 made their first contribution in https://github.com/keras-team/keras/pull/14901
    • @SamuelMarks made their first contribution in https://github.com/keras-team/keras/pull/14900
    • @Ending2015a made their first contribution in https://github.com/keras-team/keras/pull/14905
    • @anth2o made their first contribution in https://github.com/keras-team/keras/pull/14917
    • @guillesanbri made their first contribution in https://github.com/keras-team/keras/pull/14920
    • @DanBmh made their first contribution in https://github.com/keras-team/keras/pull/14903
    • @adriangb made their first contribution in https://github.com/keras-team/keras/pull/14748
    • @seanmor5 made their first contribution in https://github.com/keras-team/keras/pull/14946
    • @sfreilich made their first contribution in https://github.com/keras-team/keras/pull/14414
    • @DachuanZhao made their first contribution in https://github.com/keras-team/keras/pull/14750
    • @europeanplaice made their first contribution in https://github.com/keras-team/keras/pull/14952
    • @slowy07 made their first contribution in https://github.com/keras-team/keras/pull/15008
    • @old-school-kid made their first contribution in https://github.com/keras-team/keras/pull/15015
    • @LeonhardFeiner made their first contribution in https://github.com/keras-team/keras/pull/14982
    • @01-vyom made their first contribution in https://github.com/keras-team/keras/pull/15075
    • @rthadur made their first contribution in https://github.com/keras-team/keras/pull/15176
    • @YoniChechik made their first contribution in https://github.com/keras-team/keras/pull/15177
    • @harupy made their first contribution in https://github.com/keras-team/keras/pull/15197
    • @collinzrj made their first contribution in https://github.com/keras-team/keras/pull/15201
    • @ddrakard made their first contribution in https://github.com/keras-team/keras/pull/15215
    • @MohamedAliRashad made their first contribution in https://github.com/keras-team/keras/pull/15227
    • @jackd made their first contribution in https://github.com/keras-team/keras/pull/15199
    • @tarun-bisht made their first contribution in https://github.com/keras-team/keras/pull/15237
    • @arubiales made their first contribution in https://github.com/keras-team/keras/pull/14970
    • @krishrustagi made their first contribution in https://github.com/keras-team/keras/pull/15251
    • @mikael-epigram made their first contribution in https://github.com/keras-team/keras/pull/15288
    • @DLPerf made their first contribution in https://github.com/keras-team/keras/pull/15295
    • @Rishit-dagli made their first contribution in https://github.com/keras-team/keras/pull/15321
    • @FancyXun made their first contribution in https://github.com/keras-team/keras/pull/15363
    • @bhack made their first contribution in https://github.com/keras-team/keras/pull/15343
    • @carmineds made their first contribution in https://github.com/keras-team/keras/pull/15370
    • @WingsBrokenAngel made their first contribution in https://github.com/keras-team/keras/pull/15356
    • @AdityaKane2001 made their first contribution in https://github.com/keras-team/keras/pull/15315
    • @cemsina made their first contribution in https://github.com/keras-team/keras/pull/15399
    • @mikuh made their first contribution in https://github.com/keras-team/keras/pull/15422
    • @FabianGroeger96 made their first contribution in https://github.com/keras-team/keras/pull/15423
    • @diggerk made their first contribution in https://github.com/keras-team/keras/pull/15473
    • @sachinprasadhs made their first contribution in https://github.com/keras-team/keras/pull/15476
    • @mfidabel made their first contribution in https://github.com/keras-team/keras/pull/15459
    • @sebastian-sz made their first contribution in https://github.com/keras-team/keras/pull/14935
    • @kianmeng made their first contribution in https://github.com/keras-team/keras/pull/15543
    • @MohamadJaber1 made their first contribution in https://github.com/keras-team/keras/pull/15626
    • @sanatmpa1 made their first contribution in https://github.com/keras-team/keras/pull/15604
    • @leondgarse made their first contribution in https://github.com/keras-team/keras/pull/15612
    • @karlhigley made their first contribution in https://github.com/keras-team/keras/pull/15264
    • @zhjunqin made their first contribution in https://github.com/keras-team/keras/pull/15520
    • @kykim0 made their first contribution in https://github.com/keras-team/keras/pull/15683
    • @mishc9 made their first contribution in https://github.com/keras-team/keras/pull/15720
    • @aliencaocao made their first contribution in https://github.com/keras-team/keras/pull/15814

    Full Changelog: https://github.com/keras-team/keras/compare/v2.7.0-rc0...v2.8.0-rc0

    Source code(tar.gz)
    Source code(zip)
  • v2.7.0(Nov 3, 2021)

  • v2.7.0-rc2(Oct 28, 2021)

    What's Changed

    • Fix tf_idf output mode for lookup layers by @mattdangerw in https://github.com/keras-team/keras/pull/15492
    • Disable the failing tests due to numpy 1.20 change by @qlzh727 in https://github.com/keras-team/keras/pull/15552

    Full Changelog: https://github.com/keras-team/keras/compare/v2.7.0-rc1...v2.7.0-rc2

    Source code(tar.gz)
    Source code(zip)
  • v2.7.0-rc1(Oct 5, 2021)

  • v2.7.0-rc0(Sep 27, 2021)

  • v2.6.0(Aug 9, 2021)

    Keras 2.6.0 is the first release of TensorFlow implementation of Keras in the present repo.

    The code under tensorflow/python/keras is considered legacy and will be removed in future releases (tf 2.7 or later). For any user who import tensorflow.python.keras, please update your code to public tf.keras instead.

    The API endpoints for tf.keras stay unchanged, but are now backed by the keras PIP package. All Keras-related PRs and issues should now be directed to the GitHub repository keras-team/keras.

    For the detailed release notes about tf.keras behavior changes, please take a look for tensorflow release notes.

    Source code(tar.gz)
    Source code(zip)
  • v2.6.0-rc3(Aug 4, 2021)

  • v2.6.0-rc2(Jul 26, 2021)

    Keras 2.6.0 RC2 is a minor bug-fix release.

    1. Fix TextVectorization layer with output_sequence_length on unknown input shapes.
    2. Output int64 by default from Discretization layer.
    3. Fix serialization of Hashing layer.
    4. Add more explicit error message for instance type checking of optimizer.
    Source code(tar.gz)
    Source code(zip)
  • v2.6.0-rc1(Jul 26, 2021)

  • v2.6.0-rc0(Jul 26, 2021)

    Keras 2.6.0 is the first release of TensorFlow implementation of Keras in the present repo.

    The code under tensorflow/python/keras is considered legacy and will be removed in future releases (tf 2.7 or later). For any user who import tensorflow.python.keras, please update your code to public tf.keras instead.

    The API endpoints for tf.keras stay unchanged, but are now backed by the keras PIP package. All Keras-related PRs and issues should now be directed to the GitHub repository keras-team/keras.

    For the detailed release notes about tf.keras behavior changes, please take a look for tensorflow release notes.

    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(Jun 17, 2020)

    As previously announced, we have discontinued multi-backend Keras to refocus exclusively on the TensorFlow implementation of Keras.

    In the future, we will develop the TensorFlow implementation of Keras in the present repo, at keras-team/keras. For the time being, it is being developed in tensorflow/tensorflow and distributed as tensorflow.keras. In this future, the keras package on PyPI will be the same as tf.keras.

    This release (2.4.0) simply redirects all APIs in the standalone keras package to point to tf.keras. This helps address user confusion regarding differences and incompatibilities between tf.keras and the standalone keras package. There is now only one Keras: tf.keras.

    • Note that this release may be breaking for some workflows when going from Keras 2.3.1 to 2.4.0. Test before upgrading.
    • Note that we still recommend that you import Keras as from tensorflow import keras, rather than import keras, for the time being.
    Source code(tar.gz)
    Source code(zip)
  • 2.3.1(Oct 7, 2019)

    Keras 2.3.1 is a minor bug-fix release. In particular, it fixes an issue with using Keras models across multiple threads.

    Changes

    • Bug fixes
    • Documentation fixes
    • No API changes
    • No breaking changes
    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Sep 17, 2019)

    Keras 2.3.0 is the first release of multi-backend Keras that supports TensorFlow 2.0. It maintains compatibility with TensorFlow 1.14, 1.13, as well as Theano and CNTK.

    This release brings the API in sync with the tf.keras API as of TensorFlow 2.0. However note that it does not support most TensorFlow 2.0 features, in particular eager execution. If you need these features, use tf.keras.

    This is also the last major release of multi-backend Keras. Going forward, we recommend that users consider switching their Keras code to tf.keras in TensorFlow 2.0. It implements the same Keras 2.3.0 API (so switching should be as easy as changing the Keras import statements), but it has many advantages for TensorFlow users, such as support for eager execution, distribution, TPU training, and generally far better integration between low-level TensorFlow and high-level concepts like Layer and Model. It is also better maintained.

    Development will focus on tf.keras going forward. We will keep maintaining multi-backend Keras over the next 6 months, but we will only be merging bug fixes. API changes will not be ported.

    API changes

    • Add size(x) to backend API.
    • add_metric method added to Layer / Model (used in a similar way as add_loss, but for metrics), as well as the metrics property.
    • Variables set as attributes of a Layer are now tracked in layer.weights (including layer.trainable_weights or layer.non_trainable_weights as appropriate).
    • Layers set as attributes of a Layer are now tracked (so the weights/metrics/losses/etc of a sublayer are tracked by parent layers). This behavior already existed for Model specifically and is now extended to all Layer subclasses.
    • Introduce class-based losses (inheriting from Loss base class). This enables losses to be parameterized via constructor arguments. Loss classes added:
      • MeanSquaredError
      • MeanAbsoluteError
      • MeanAbsolutePercentageError
      • MeanSquaredLogarithmicError
      • BinaryCrossentropy
      • CategoricalCrossentropy
      • SparseCategoricalCrossentropy
      • Hinge
      • SquaredHinge
      • CategoricalHinge
      • Poisson
      • LogCosh
      • KLDivergence
      • Huber
    • Introduce class-based metrics (inheriting from Metric base class). This enables metrics to be stateful (e.g. required for supported AUC) and to be parameterized via constructor arguments. Metric classes added:
      • Accuracy
      • MeanSquaredError
      • Hinge
      • CategoricalHinge
      • SquaredHinge
      • FalsePositives
      • TruePositives
      • FalseNegatives
      • TrueNegatives
      • BinaryAccuracy
      • CategoricalAccuracy
      • TopKCategoricalAccuracy
      • LogCoshError
      • Poisson
      • KLDivergence
      • CosineSimilarity
      • MeanAbsoluteError
      • MeanAbsolutePercentageError
      • MeanSquaredError
      • MeanSquaredLogarithmicError
      • RootMeanSquaredError
      • BinaryCrossentropy
      • CategoricalCrossentropy
      • Precision
      • Recall
      • AUC
      • SparseCategoricalAccuracy
      • SparseTopKCategoricalAccuracy
      • SparseCategoricalCrossentropy
    • Add reset_metrics argument to train_on_batch and test_on_batch. Set this to True to maintain metric state across different batches when writing lower-level training/evaluation loops. If False, the metric value reported as output of the method call will be the value for the current batch only.
    • Add model.reset_metrics() method to Model. Use this at the start of an epoch to clear metric state when writing lower-level training/evaluation loops.
    • Rename lr to learning_rate for all optimizers.
    • Deprecate argument decay for all optimizers. For learning rate decay, use LearningRateSchedule objects in tf.keras.

    Breaking changes

    • TensorBoard callback:
      • batch_size argument is deprecated (ignored) when used with TF 2.0
      • write_grads is deprecated (ignored) when used with TF 2.0
      • embeddings_freq, embeddings_layer_names, embeddings_metadata, embeddings_data are deprecated (ignored) when used with TF 2.0
    • Change loss aggregation mechanism to sum over batch size. This may change reported loss values if you were using sample weighting or class weighting. You can achieve the old behavior by making sure your sample weights sum to 1 for each batch.
    • Metrics and losses are now reported under the exact name specified by the user (e.g. if you pass metrics=['acc'], your metric will be reported under the string "acc", not "accuracy", and inversely metrics=['accuracy'] will be reported under the string "accuracy".
    • Change default recurrent activation to sigmoid (from hard_sigmoid) in all RNN layers.
    Source code(tar.gz)
    Source code(zip)
  • 2.2.5(Aug 22, 2019)

    Keras 2.2.5 is the last release of Keras that implements the 2.2.* API. It is the last release to only support TensorFlow 1 (as well as Theano and CNTK).

    The next release will be 2.3.0, which makes significant API changes and add support for TensorFlow 2.0. The 2.3.0 release will be the last major release of multi-backend Keras. Multi-backend Keras is superseded by tf.keras.

    At this time, we recommend that Keras users who use multi-backend Keras with the TensorFlow backend switch to tf.keras in TensorFlow 2.0. tf.keras is better maintained and has better integration with TensorFlow features.

    API Changes

    • Add new Applications: ResNet101, ResNet152, ResNet50V2, ResNet101V2, ResNet152V2.
    • Callbacks: enable callbacks to be passed in evaluate and predict.
      • Add callbacks argument (list of callback instances) in evaluate and predict.
      • Add callback methods on_train_batch_begin, on_train_batch_end, on_test_batch_begin, on_test_batch_end, on_predict_batch_begin, on_predict_batch_end, as well as on_test_begin, on_test_end, on_predict_begin, on_predict_end. Methods on_batch_begin and on_batch_end are now aliases for on_train_batch_begin and on_train_batch_end.
    • Allow file pointers in save_model and load_model (in place of the filepath)
    • Add name argument in Sequential constructor
    • Add validation_freq argument in fit, controlling the frequency of validation (e.g. setting validation_freq=3 would run validation every 3 epochs)
    • Allow Python generators (or Keras Sequence objects) to be passed in fit, evaluate, and predict, instead of having to use *_generator methods.
      • Add generator-related arguments max_queue_size, workers, use_multiprocessing to these methods.
    • Add dilation_rate argument in layer DepthwiseConv2D.
    • MaxNorm constraint: rename argument m to max_value.
    • Add dtype argument in base layer (default dtype for layer's weights).
    • Add Google Cloud Storage support for model.save_weights and model.load_weights.
    • Add JSON-serialization to the Tokenizer class.
    • Add H5Dict and model_to_dot to utils.
    • Allow default Keras path to be specified at startup via environment variable KERAS_HOME.
    • Add arguments expand_nested, dpi to plot_model.
    • Add update_sub, stack, cumsum, cumprod, foldl, foldr to CNTK backend
    • Add merge_repeated argument to ctc_decode in TensorFlow backend

    Thanks to the 89 committers who contributed code to this release!

    Source code(tar.gz)
    Source code(zip)
  • 2.2.4(Oct 3, 2018)

    This is a bugfix release, addressing two issues:

    • Ability to save a model when a file with the same name already exists.
    • Issue with loading legacy config files for the Sequential model.

    See here for the changelog since 2.2.2.

    Source code(tar.gz)
    Source code(zip)
  • 2.2.3(Oct 1, 2018)

    Areas of improvement

    • API completeness & usability improvements
    • Bug fixes
    • Documentation improvements

    API changes

    • Keras models can now be safely pickled.
    • Consolidate the functionality of the activation layers ThresholdedReLU and LeakyReLU into the ReLU layer.
    • As a result, the ReLU layer now takes new arguments negative_slope and threshold, and the relu function in the backend takes a new threshold argument.
    • Add update_freq argument in TensorBoard callback, controlling how often to write TensorBoard logs.
    • Add the exponential function to keras.activations.
    • Add data_format argument in all 4 Pooling1D layers.
    • Add interpolation argument in UpSampling2D layer and in resize_images backend function, supporting modes "nearest" (previous behavior, and new default) and "bilinear" (new).
    • Add dilation_rate argument in Conv2DTranspose layer and in conv2d_transpose backend function.
    • The LearningRateScheduler now receives the lr key as part of the logs argument in on_epoch_end (current value of the learning rate).
    • Make GlobalAveragePooling1D layer support masking.
    • The the filepath argument save_model and model.save() can now be a h5py.Group instance.
    • Add argument restore_best_weights to EarlyStopping callback (optionally reverts to the weights that obtained the highest monitored score value).
    • Add dtype argument to keras.utils.to_categorical.
    • Support run_options and run_metadata as optional session arguments in model.compile() for the TensorFlow backend.

    Breaking changes

    • Modify the return value of Sequential.get_config(). Previously, the return value was a list of the config dictionaries of the layers of the model. Now, the return value is a dictionary with keys layers, name, and an optional key build_input_shape. The old config is equivalent to new_config['layers']. This makes the output of get_config consistent across all model classes.

    Credits

    Thanks to our 38 contributors whose commits are featured in this release:

    @BertrandDechoux, @ChrisGll, @Dref360, @JamesHinshelwood, @MarcoAndreaBuchmann, @ageron, @alfasst, @blue-atom, @chasebrignac, @cshubhamrao, @danFromTelAviv, @datumbox, @farizrahman4u, @fchollet, @fuzzythecat, @gabrieldemarmiesse, @hadifar, @heytitle, @hsgkim, @jankrepl, @joelthchao, @knightXun, @kouml, @linjinjin123, @lvapeab, @nikoladze, @ozabluda, @qlzh727, @roywei, @rvinas, @sriyogesh94, @tacaswell, @taehoonlee, @tedyu, @xuhdev, @yanboliang, @yongzx, @yuanxiaosc

    Source code(tar.gz)
    Source code(zip)
  • 2.2.2(Jul 28, 2018)

  • 2.2.1(Jul 27, 2018)

    Areas of improvement

    • Bugs fixes
    • Performance improvements
    • Documentation improvements

    API changes

    • Add output_padding argument in Conv2DTranspose (to override default padding behavior).
    • Enable automatic shape inference when using Lambda layers with the CNTK backend.

    Breaking changes

    No breaking changes recorded.

    Credits

    Thanks to our 33 contributors whose commits are featured in this release:

    @Ajk4, @Anner-deJong, @Atcold, @Dref360, @EyeBool, @ageron, @briannemsick, @cclauss, @davidtvs, @dstine, @eTomate, @ebatuhankaynak, @eliberis, @farizrahman4u, @fchollet, @fuzzythecat, @gabrieldemarmiesse, @jlopezpena, @kamil-kaczmarek, @kbattocchi, @kmader, @kvechera, @maxpumperla, @mkaze, @pavithrasv, @rvinas, @sachinruk, @seriousmac, @soumyac1999, @taehoonlee, @yanboliang, @yongzx, @yuyang-huang

    Source code(tar.gz)
    Source code(zip)
Owner
Keras
Deep Learning for humans
Keras
Reproduced Code for Image Forgery Detection papers.

Image Forgery Detection With over 4.5 billion active internet users, the amount of multimedia content being shared every day has surpassed everyone’s

Umar Masud 15 Dec 06, 2022
Distributed Evolutionary Algorithms in Python

DEAP DEAP is a novel evolutionary computation framework for rapid prototyping and testing of ideas. It seeks to make algorithms explicit and data stru

Distributed Evolutionary Algorithms in Python 4.9k Jan 05, 2023
A Comprehensive Study on Learning-Based PE Malware Family Classification Methods

A Comprehensive Study on Learning-Based PE Malware Family Classification Methods Datasets Because of copyright issues, both the MalwareBazaar dataset

8 Oct 21, 2022
Extension to fastai for volumetric medical data

FAIMED 3D use fastai to quickly train fully three-dimensional models on radiological data Classification from faimed3d.all import * Load data in vari

Keno 26 Aug 22, 2022
A PyTorch implementation for PyramidNets (Deep Pyramidal Residual Networks)

A PyTorch implementation for PyramidNets (Deep Pyramidal Residual Networks) This repository contains a PyTorch implementation for the paper: Deep Pyra

Greg Dongyoon Han 262 Jan 03, 2023
Revisiting Contrastive Methods for Unsupervised Learning of Visual Representations. [2021]

Revisiting Contrastive Methods for Unsupervised Learning of Visual Representations This repo contains the Pytorch implementation of our paper: Revisit

Wouter Van Gansbeke 80 Nov 20, 2022
Multi-modal Text Recognition Networks: Interactive Enhancements between Visual and Semantic Features

Multi-modal Text Recognition Networks: Interactive Enhancements between Visual and Semantic Features | paper | Official PyTorch implementation for Mul

48 Dec 28, 2022
This repository contains code used to audit the stability of personality predictions made by two algorithmic hiring systems

Stability Audit This repository contains code used to audit the stability of personality predictions made by two algorithmic hiring systems, Humantic

Data, Responsibly 4 Oct 27, 2022
CRF-RNN for Semantic Image Segmentation - PyTorch version

This repository contains the official PyTorch implementation of the "CRF-RNN" semantic image segmentation method, published in the ICCV 2015

Sadeep Jayasumana 170 Dec 13, 2022
Negative Sample Matters: A Renaissance of Metric Learning for Temporal Grounding

2D-TAN (Optimized) Introduction This is an optimized re-implementation repository for AAAI'2020 paper: Learning 2D Temporal Localization Networks for

Joya Chen 112 Dec 31, 2022
🥈78th place in Riiid Answer Correctness Prediction competition

Riiid Answer Correctness Prediction Introduction This repository is the code that placed 78th in Riiid Answer Correctness Prediction competition. Requ

Jungwoo Park 10 Jul 14, 2022
Optimising chemical reactions using machine learning

Summit Summit is a set of tools for optimising chemical processes. We’ve started by targeting reactions. What is Summit? Currently, reaction optimisat

Sustainable Reaction Engineering Group 75 Dec 14, 2022
PyTorch implementation of Federated Learning with Non-IID Data, and federated learning algorithms, including FedAvg, FedProx.

Federated Learning with Non-IID Data This is an implementation of the following paper: Yue Zhao, Meng Li, Liangzhen Lai, Naveen Suda, Damon Civin, Vik

Youngjoon Lee 48 Dec 29, 2022
Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering

Nvdiffrast – Modular Primitives for High-Performance Differentiable Rendering Modular Primitives for High-Performance Differentiable Rendering Samuli

NVIDIA Research Projects 675 Jan 06, 2023
retweet 4 satoshi ⚡️

rt4sat retweet 4 satoshi This bot is the codebase for https://twitter.com/rt4sat please feel free to create an issue if you saw any bugs basically thi

6 Sep 30, 2022
Fermi Problems: A New Reasoning Challenge for AI

Fermi Problems: A New Reasoning Challenge for AI Fermi Problems are questions whose answer is a number that can only be reasonably estimated as a prec

AI2 15 May 28, 2022
Tool cek opsi checkpoint facebook!

tool apa ini? cek_opsi_facebook adalah sebuah tool yang mengecek opsi checkpoint akun facebook yang terkena checkpoint! tujuan dibuatnya tool ini? too

Muhammad Latif Harkat 2 Jul 17, 2022
Breaking the Dilemma of Medical Image-to-image Translation

Breaking the Dilemma of Medical Image-to-image Translation Supervised Pix2Pix and unsupervised Cycle-consistency are two modes that dominate the field

Kid Liet 86 Dec 21, 2022
ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs

ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs This is the code of paper ConE: Cone Embeddings for Multi-Hop Reasoning over Knowl

MIRA Lab 33 Dec 07, 2022
The codes and related files to reproduce the results for Image Similarity Challenge Track 2.

ISC-Track2-Submission The codes and related files to reproduce the results for Image Similarity Challenge Track 2. Required dependencies To begin with

Wenhao Wang 89 Jan 02, 2023