# Tag Info

## Hot answers tagged tensorflow

13

What you are looking for is called "reinforcement learning". A reinforcement learning algorithm will try to maximize a reward function. This reward represents how "good" or "bad" an action is in the actual context. For example, in the snake game, your reward will be positive for eating an apple and negative when the snake hits a ...

4

There are a few possible approaches to deploying a ML model to a microcontroller. The main limiting factor to deployment on microcontollers is that ML models are usually a representation of a set of parameters that are intended to be used as input to a prediction algorithm alongside a new datapoint. Most such models assume the presence of an accompanying ...

3

My guess: If you add a few CNN layers before the input of the given model and train only those layers while keeping the given model's parameters frozen, you might get better result. Essentially these few extra layers would "transform" your input image into the appropriate shape, but with more accuracy since its trained and not hard coded.

3

Your statement that researchers build their network from the ground-up using C++ or some other low level library couldn't be further from the truth. You could take a look at this analysis showing the popularity of these two frameworks in the top ML conferences. The following Figure is taken from there. In CVPR-2020, for example, TensorFlow and pytorch ...

3

By convention, the $\mathrm{ReLU}$ activation is treated as if it is differentiable at zero (e.g. in [1]). Therefore it makes sense for TensorFlow to adopt this convention for tf.nn.relu. As you've found, of course, it's not true in general that we treat the gradient of the absolute value function as zero in the same situation; it makes sense for it to be an ...

3

In regression, the goal is to approximate a function $f: \mathcal{I} \rightarrow \mathbb{R}$, so $f(x) \in \mathbb{R}$. In other words, in regression, you want to learn a function whose outputs can be any number, so not necessarily just a number in the range $[0, 1]$. You use the sigmoid as the activation function of the output layer of a neural network, for ...

3

There are a few issues you need to address first. Normalise your data. You should try and keep your values for each input in a good range, otherwise you're never going to train anything useful. A simple way of doing this could be to divide each value by the maximum value for that input. This will ensure they are between 0 and 1, or you could divide by the ...

2

You could sequentially pass in each element of your sequential data and save the hidden and cell states in a separate buffer. In a typical LSTM implementation, you input the entire sequence and the hidden and cell states are propagated internally. In the end, the final hidden and cell states returned as the output. This works if your input is all the same ...

2

There have been many researches in dynamic difficulty adjustment (DDA). I see this one is quite explaining: AI for Dynamic Difficulty Adjustment in Games. However, there are many factors when we are trying to do dynamic difficulty adjustment. As explained in paper above, one major problem is it is sometimes hard to make sure the created model will still ...

2

A 2D convolution is a convolution where the kernel has the same depth as the input, so, in theory, you do not need to specify the depth of the kernel, if you know the depth of the input. I don't know which library you are referring to (although you tagged your post with TensorFlow and Keras), but, in TensorFlow, you only need to specify the width and height ...

2

The approach that you don't train the whole net, but just the latter part of it (all starting with lstm in our case), can actually work. The idea is that the inception was already pretrained a very large dataset (imagenet for instance). And it's capable of extracting some useful information from it. Actually there are different domains of images in the ...

2

The main benefit of deep learning is that you don't have to manually design features. Classic Machine Learning algorithms always include the Feature engineering step, whereas neural networks are able to crate features automatically during learning. The classic example is CNN. In the first layer it creates simple features that representing lines, the last ...

2

Assume the image can contain objects of class $C_1 \dots C_c$. Assume a set of additional inputs that has a meaning of questions as "contains the image a C_i or C_j or ... ?". The main problem for the system is classify the image in classes $C_i$. Second problem is answer the implicit question proposed by the remainder inputs. Thus, better combine ...

2

I found: For scikit-learn like models: MicroML, Micro-LM, Micro Learn, sklearn-porter, emlearn For deep learning models: tensorflow Lite Micro, X-CUBE-AI, Glow, NNoM Both: EdgeML, ELL These seems to partly fit my needs. But i am surprised that i cannot find something more general that either convert Python to C or to object file with ML support (to be used ...

2

If the library running the model can be compiled for your microcontroller, then you can run your model on that microcontroller. If you train using one library and deploy using another library, you possible can convert your model to that library: ONNX. Some library links on Edge Computing in ML: Microcontroller support for Tensorflow Lite Edge ML PyTorch ...

2

It turns out that the solution to this problem is in the version of h5py. If you have h5py == 3.1.* then you need to downgraded it to h5py == 2.10.0 Version of Keras needs to be 2.2.4 Or you can upgrade the version of Keras to 2.2.5

1

Your task is text recognition, however your code is for classification task. So you need to use different approach for that. You mentioned that you're going to give model 123 and get 123. But you can not do that with just convolutional networks. Images with text are sequential, so you need to use CRNN(Convolutional-Recurrent-Neural-Networks), LSTM(Long-Short-...

1

Firstly, concatenate only works on identical output shape of the axis. Otherwise, the function will not work. Now, your function output size is (None, 32, 50) and (None, 600, 1). Here, '32' and '600' must be same when you want to concatenate. I would like to suggest some advice based on your problem. You can flatten both of them first and then concatenate. ...

1

Is it training at all? Or is agent performance not improving over time? Q learning can be pretty unstable. I would recommend logging the sum of rewards received by the agent at the end of each episode and the model loss to help in the debugging process. The sum of rewards will show you if the agent is improving over time and the model loss will give you a ...

1

When it comes to GPU usage, nvidia-smi shows the usage at the time it was executed. You should try running watch -n0.01 nvidia-smi to see the usage of GPU every 0.01 second. It should output some small usage for current model, like 5%. You could try to increase you model, to e.g. self.d1 = Dense(1024, input_shape=(input_size,), activation="relu") ...

1

Bias is one of the hyperparameters in neural networks, which let you shift activation function. Disabling bias means setting bias to be zero. Even though, in many cases, bias is a big help for successful learning, in some cases, you may want to add an extra constraint to your neural network in finding the objective function. For example, in the paper below, ...

1

Can my loss function be evaluating the model until it dies? 1/survival time could be the loss value to be minimized by gradient descent. In order to use backpropagation and gradient descent, you have to relate the loss function directly to the output of the neural network. Your proposed loss function is too indirect, it is not possible to turn it directly ...

1

Google recommandation seems to answer this: The training data should be as close as possible to the data on which predictions are to be made. For example, if your use case involves blurry and low-resolution images (such as from a security camera), your training data should be composed of blurry, low-resolution images. In general, you should also consider ...

1

you could also just use a Task-agnostic CNN as an encoder to get extract features like in (1) and then use the output of the last global pooling layer and then feed that as an input to the LSTM layer or any other downstream task. Add another small Neural Network (projection head) after the CNN. And then use contrastive loss on output of this projection head ...

1

You can calculate the memory requirement analytically, but it's still not going to beat physical test in practice as there are so many unknown variables in the system which can takes the GPU memory. Maybe tensorflow will decide to store the gradients, then you have to take into account the memory usage of it also. The way I do it is by setting the GPU memory ...

1

In fact, I do not know how to calculate GPU memory to run a neural network but I have a solution for allocation problems in GPUs while using tensorflow framework. import tensorflow as tf gpus = tf.config.experimental.list_physical_devices('GPU') if gpus: # Restrict TensorFlow to only allocate 2GB * 2 of memory on the first GPU try: tf.config....

1

I depends on your overall model architecture (and problem specification). As I understand it, you take the observations of all agents together and feed it into one model, a central controller, which then predicts the action per available agent. I believe that this varying number of applicable observations (depending on the number of currently present agents) ...

1

It doesn't drops rows or columns, it acts directly on scalars. The Dropout Layer keras documentation explains it and illustrates it with an example : The Dropout layer randomly sets input units to 0 with a frequency of rate After an Dense Layer, the Dropout inputs are directly the outputs of the Dense layer neurons, as you said. After your embedding layer, ...

1

This Cross Validated post might answer your question. In a nutshell: A single batch (that is all your data in one batch) will result in a smooth trajectory on the loss surface. The drawback is that all your data might not fit into your memory. Which is highly likely for ~100k images. One image per batch (batch size = no. examples) will result in a more ...

1

? This means that there are not promising versions of this algorithm fro regression until 2012. After your question, I have found one of the survey research paper which is done or ensemple methods for regression. This table also extracted from this paper. Read this paper, it will help you a lot more This one is latest paper published on object detection with ...

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