comprising one or more training iterations, where the weights of the neural network are changed in order to improve the performance of the neural network on the input data. In this operation, the neural network may deviate from its generalization capabilities and will become instead specific or fine-tuned on the input data on which it was optimized. This optimization operation may performed at inference time and not at training time. I.e., it may be performed during encoding or decoding the data. 

The overfitting may be performed on a block-level. Therefore, an image can be divided into blocks and a neural network will be fine-tuned on at least one block. According to an embodiment the blocks are non-overlapping. For video data, a network may be optimized on at least one block and at least one frame, or alternatively it may be optimized on at least one whole frame. 

The first and second embodiments are described in more detailed manner in the following. 

## First embodiment: sequential encoder overfittinq 

In an example of the first embodiment, shown in Fig. 3 evaluation is performed by overfitting the candidate neural networks on the current block, and the choosing the best neural network. 

The transmitter receives an input image 300 (or other data) which needs to be encoded. The transmitter has at least one baseline encoder network 3 10 (i.e. encoder of the pretrained auto-encoder). The transmitter may divide the image 300 into blocks (1, 2, 3, 4, ...., 12, ...), if the image hasn’t been already divided. After that, the transmitter overfits a neural encoder network 305 to each block of the image. Alternatively, the transmitter may decide to overfit neural encoder network to a subset of all blocks, and to use the neural network overfitted on neighboring blocks for encoding the blocks on which no overfitting was performed. Flowever, for the sake of simplicity, in an example of this embodiment, the transmitter has overfitted one neural encoder network for each block. 

For overfitting on the first block (which may be anywhere in the image but it is considered here to be the top-left most block with number 1), the only available neural encoder network is the baseline encoder 3 10, so the overfitting will start from the baseline encoder 3 10. A copy of the original baseline encoder may be made 

