Any way to manually make a variable more important in a machine learning model? [closed] - optimization

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Sometimes you know by experience or by some expert knowledge some variable will play a key role in this model, is there a way to manually make the variable count more so the training process can speed up and the method can combine some human knowledge/wisdom/intelligence.
I still think machine learning combined with human knowledge is the strongest weapon we have now

This might work by scaling your input data accordingly.
On the other hand the strength of a neural network is to figure out
which features are in fact important and which combinations with other
features are important - from the data.
You might argue, that you'll decrease training time. Somebody else might argue that you're biasing your training in such a way that it might even take more time.
Anyway if you would want to do this, assuming a fully connected layer, you could increasedly initialize the weights of the input feature you found important.
Another way, could be to first pretrain the model according to a training loss, that should have your feature as an output. Than keep the weights and switch to the actual loss - I have never tried this, but it could work.

Related

predict the position of an image in another image [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
If one image is a part of another image, then how to compute the accurate location in deep learning way?
Now I could compute this by extracting and matching key points using OpenCV, but I hope to solve it with neural networks.
Any ideas to design the networks and loss functions?
Thanks very much.
This is a detection problem. The simplest approach to do it is to create a a network with two heads, one for classification and the other for the bounding box (regression).
you feed your network with the image and respective label, and sum the lossess and do a backward. train for some epochs and you'll get your self a detection model that you can use to detect what you need. but its just a simple approach and it can get much more complex.
You may as well skip this and use an existing detection architecture or better framework which simplifies your life much better.
For Tensorflow I belive you can use ObjectDetctionAPI and for Pytorch you can use Detectron, Detectron2, mmdetection among others.

why can't I reimplement my tensorflow model with pytorch? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I am developing a model in tensorflow and find that it is good on my specific evaluation method. But when I transfer to pytorch, I can't achieve the same results. I have checked the model architecture, the weight init method, the lr schedule, the weight decay, momentum and epsilon used in BN layer, the optimizer, and the data preprocessing. All things are the same. But I can't get the same results as in tensorflow. Anybody have met the same problem?
I did a similar conversion recently.
First you need to make sure that the forward path produces the same results: disable all randomness, initialize with the same values, give it a very small input and compare. If there is a discrepancy, disable parts of the network and compare enabling layers one by one.
When the forward path is confirmed, check the loss, gradients, and updates after one forward-backward cycle.

How to get all the weight updates from Word2Vec [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am not only interested in the final W0 and W1 (also, to some known as W and W'), but all the variations of these two matrices during the learning.
For now, I am using the gensim implementation, but compared to sklearn, gensim's API is not very well organized in my mind. Hence, I am open to moving to tf if need be, given that getting access to these values would be possible/easier.
I know I can hack the main code; my question is whether there already is a function/variable for it.
There's no specific API for seeing individual training example updates, or interim weights mid-training.
But as you've intuited, instead of calling train() once, letting it run all epochs and all learning-rate-updates (as is recommended), you could call it one epoch at a time, providing it the right incremental start_alpha and end_alpha yourself each call, and between the calls look at the word-vectors (aka "projection weights") and hidden-to-output weights (syn1neg for default negative-sampling, or syn1 for hierarchical-softmax).
If you needed more fine-grained reporting, you'd need to modify the source code to add the extra logging/callouts/etc you need.

validation accuracy of convolutional neural network [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Hi I'm new to deep learning and convolutional neural network. Could someone please explain the problem in the figure below? Someone told me that the fluctuation of validation accuracy is the problem here. But I don't quite understand the negative effect of this fluctuation. Why don't we just look at the last point of the figure?
enter image description here
When training a deep learning module you have to validate it.
Which means you are showing the unseen data to algorithm.
So validation accuracy can be less that the training accuracy. Because there's an scenario called over-fitting. Where your training algorithm is too much attached to training data and does not generalize well to other unseen data.
On the fluctuating issue it can be normal. Because we training and testing the algorithm is a stochastic manner.

project topic for neural network for freshers? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to start working on neural network for my final project I want a topic which could be completed on 2-3 months of work and also It should be of good understanding for a fresher, as I am new to this topic and I want to learn by doing this project. It should not be very tough to understand and start work.
You could write a simple OCR using a Hopfield neural network.
A good start would be:
A comparative study of neural network algorithms applied to optical character recognition
Hopfield Networks: A Simple OCR Application
It is a relatively simple fun project.
It would be even easier if you could use Matlab and some of its modules. But even if you were to implement it in Java or some similar language, I think it should be doable in 3 months for a beginner.
In Matlab, you could start with the following:
Hopfield Neural Network
Hopfield Two Neuron Design
You will need the Neural Network Toolbox which has to be purchased separately I think.
Your first question should be what and not how you want to classify. Depending on the problem, you can choose a fitting classifier. It's hard for you to decide the detailed solution before knowing the actual problem.
Simple topics (depending on your personal background) can be text, audio or image analysis. OCR is quite typical (you can use the MNIST database for that, it's well researched so you can compare your own results). To get a general idea of what applications are out there, you should also definitely have a look at the UCI database. It has all sorts of data.
The easiest Type of Neural Network to understand and implement is a Single Layer Perceptron. To also classify non-linearly seperable data (which is needed in most real-world scenarios), you can use a Multi Layer Perceptron with 3 layers (in/hidden/out).