Categories
Mastering Development

Canvas scrolling up when it shouldn’t

I have a canvas canvas = tk.Canvas(app, bd=0, highlightthickness=0, bg=style.background) canvas.pack(side=”left”, fill=”both”, expand=True) I have a scrollbar in that canvas def onFrameConfigure(canvas): # Reset the scroll region to encompass the inner frame canvas.configure(scrollregion=canvas.bbox(“all”)) scrollbar = tk.Scrollbar(app, orient=”vertical”, command=canvas.yview) canvas.configure(yscrollcommand=scrollbar.set) scrollbar.pack(side=”right”, fill=”y”) main_frame.bind(“<Configure>”, lambda event, canvas=canvas: onFrameConfigure(canvas)) and I set the up and down keys to […]

Categories
Mastering Development

Recurrent Neural Network Incompatible Shapes

Incompatible shapes: [32,50,10] vs. [32,10] I’m missing something but I’m drawing a blank, assist please. I’m following an example in a book (Hands on Machine Learning) and I followed it and it’s saying something about my input. I tried to use keras.layers.Flatten() and didn’t work. #Editing memory cell class LNSimpleRNNCell(keras.layers.Layer): def __init__(self, units, activation=”tanh”, **kwargs): […]

Categories
Development

How to get loss gradient wrt internal layer output in tesorflow 2?

I would like to get gradient of the model’s loss function with respect to specific layer’s output during training. What I want to do with it next, is using a value of that gradient to modify something in layer in the next learning epoch. So how to obtain that gradient? Here’s a minimal example. MinimalRNNCell […]

Categories
Development

Overwrite Django model __init__ method

The Ingredient model of my Django project has an IntegerField which declares if this ingredient stock is managed by weight, units, or litters. Although the database has its integer value I have to display its name. And instead of looping over every ingredient and setting its value, I thought it was better to overwrite the […]

Categories
Development Linux Ubuntu

how remove null and ctrl+m characters from csv file linux

i have csv file that start with NULL bytes that come from hive beeline cli query output , the file start with many lines that have ^Mnull^Mnull in the first lines . i tried tr -d ‘\0’ < file_with_null_bytes.csv > file_without_null_bytes.csv less file_with_null_bytes.csv ^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull ^Mnull^Mnull […]

Categories
Development

Save unbrushed data after brushing some data in Matlab plot

I am trying to programmatically save the data after brushing part of the data in matlab plot (GUI). The code, similar to the one published here, is what I am expecting. However the code is written for single line plot, I want the same for multiple plots (plotted using hold on and hold off on […]

Categories
Development

Naming weights of a layer within a custom layer

I have a custom layer within a Dense sublayer. I want to be able to name the weights of this sublayer. However, using name=”my_dense” on the sublayer initializer doesn’t seem to do this; the weights simply get named after the outer custom layer. To illustrate the problem, suppose I want a custom layer that simply […]

Categories
Development

Google chart HTML page integration in my existing project not working

I have a google chart HTML page and it draws chart fine whenever I rut it individually. the code of page is following <!doctype html> <html lang=’en’> <head> <!– Required meta tags –> <meta charset=’utf-8′> <meta name=’viewport’ content=’width=device-width, initial-scale=1, shrink-to-fit=no’> <title>Value IQ</title> <link rel=’stylesheet’ href=’https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css’> <link href=’https://fonts.googleapis.com/css?family=Roboto:400,400i,500,700&display=swap’ rel=’stylesheet’> <script type=’text/javascript’ src=’https://www.gstatic.com/charts/loader.js’></script> <link rel=’stylesheet’ href=’css/style.css’> </head> […]

Categories
Artificial Intelligence (AI) Development

Param count in last layer high

Not sure where to put this… I am trying to create a convolutional architecture for a DQN in keras, and I want to know why my param count is so high for my last layer compared to the rest of the network. I’ve tried freezing the layer, and slowly decreasing the dimensions of the layers […]

Categories
Development

Transformer model not able to be saved

I’m trying to follow this tutrial https://colab.research.google.com/github/tensorflow/examples/blob/master/community/en/transformer_chatbot.ipynb, However, when I tried to save the model in order to load it again without training I got an error mentioned here NotImplementedError: Layers with arguments in `__init__` must override `get_config` I understood from the answer that I need to make the encoder and decoder as classes and […]