4

The answer to your needs is called "bucketing". It consists of creating batches of sequences with similar length, to minimize the needed padding. In tensorflow, you can do it with tf.data.experimental.bucket_by_sequence_length. Take into account that previously it was in a different python package (tf.contrib.data.bucket_by_sequence_length), so the ...


3

The Keras Documentation indicates that filename can have the epoch number in the filename. To allow each set of data to be preserved consider using a filename more like: checkpoint_filepath = './checkpoint-{epoch:02d}.hdf5' filepath: string or PathLike, path to save the model file. filepath can contain named formatting options, which will be filled the ...


1

Found a solution, which is to pass a custom batch generator of type keras.utils.Sequence to the model.fit function (where one can write any logic to construct batches and to modify/augment training data) instead of passing the entire dataset in one go. Relevant code for reference: # Must implement the __len__ function returning the number # of batches in ...


1

The error indicates that you are trying to add tensors of incompatible dimensions, as x has 128 channels and inputs has 3 channels. The reason why x has 128 channels is just in the line above, where you pass feature_size with value 128 as the number of output channels. Change the number of output channels in that line to 3 and it should work, like this: x = ...


1

I think your question is not clear enough. You need to be exact about the job description. But I have a suggestion for you to figure this out on your own. Simply go to LinkedIn, look for the jobs you are considering (read their descriptions and responsibilities carefully). These job postings mostly come up with a list of the required experiences. This will ...


1

After doing some reasearch, I found that OpenMined (a company based on FL and Private AI) Are making strides to develop PySyft. Hence I would suggest continuing with PySyft.


1

To answer your specific questions: AdditiveAttention() and Attention() layers, are (loosely but not exactly) based on Bahdanau and Luong's attentions, respectively. They use post-2018 semantics of queries, values and keys. To map the semantics to the Bahdanau or Luong's paper, you can consider the 'query' to be the last decoder hidden state. The 'values' ...


1

The 'Attention' terminology varies before and after a landmark paper in 2018 - Attention is all you need. Before 2018 Here 'query' is the hidden state of the decoder of the previous timestep. 'Values' - All the hidden states of the encoder Remember - the 'query' attends to all the 'values' So far so good. Attention mechanisms were used widely between 2014 ...


1

You don't need that at Inference time. It's for training purposes. You can skip these Layers while exporting to JavsScript. These layers do not have weights. On this example [Link], which has these Layers, I removed these layers and it worked fine. # Added this code to remove the first 4 Aug layers input = model.input model_export = input for layer in ...


1

What you're referring to is called multi-task learning, where your goal is to have a single network learn multiple tasks (in your case "click" and "purchase"). The benefit of having a single model learn both tasks is that the network can use information extracted for one task to improve its performance on the other. Technically you need ...


1

The key is precisely in the definition of the loss: loss_object = tf.keras.losses.SparseCategoricalCrossentropy( from_logits=True, reduction='none') As you can see, the loss is created with the flag from_logits=True which means that the input to the loss is not a probability distribution, but unnormalized log probabilities, namely "logits", ...


1

The output layer does not have to be 1D (excl. batch size) but even if it is, it does not necessary mean you cannot transform it to a n dimensional space. Consider an autoencoder used to reconstruct an image: In the simplest case we could flatten a image (e.g. 24 x 24 pixels) and learn a network to predict the 24 x 24 pixels (output a 1D image). These ...


1

Getting reproducible results with Keras is not straightforward, see https://machinelearningmastery.com/reproducible-results-neural-networks-keras/, since TensorFlow, Numpy and the working environment itself can introduce different seeds affecting different parts of the training. In order to get reproducible training processes, try setting the following ...


1

Their is some random elements when using packages such as TensorFlow, Numpy etc. Some examples includes: How the weights are initialized. How the data is shuffled (if enabled) in each batch. Batches containing different data, will produce different gradients which might influence convergence. This means, that even when you run the same code it is actually ...


1

Its the number of features that has to remain consistent not the number of timestamps. Outputs will be batches of one row predictions, so in your case its 1500 and than 1000. Model does not care, features should remain same. And beware of dataleakage with time series.


1

You may use lambda callback and save it in a dictionary. weights_dict = {} weight_callback = tf.keras.callbacks.LambdaCallback \ ( on_epoch_end=lambda epoch, logs: weights_dict.update({epoch:model.get_weights()})) history = model.fit( x_train, y_train, batch_size=16, epochs=5, callbacks=weight_callback ) # retrive weights for epoch,weights in weights_dict....


Only top voted, non community-wiki answers of a minimum length are eligible