Setting sample weights for training of network to set the

Technical Source
2 min readJun 21, 2021

--

Setting sample weights for training of network to set the contribution of each sample to the network outcome

What I need to do is train a classification network (like Pattern Recognition Tool) where each sample would have a different weight. The contribution of a sample to the network error would be proportional to its weight.

For example, given samples with higher and lower weights; after training the network would classify the samples with higher weights with a more success while sacrificing some correct classification of the samples with lower weights.

Does anyone know how to do this?

Currently my only idea on how to achieve this goal would be: For each iteration of a loop:

1. randomly assemble a subset of samples with a chance of picking a sample proportional to its weight.

2. train for 1 epoch

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

You will have to go thru those 5 BioID threads. I can’t remember the details.

However, if the ordinary classification scheme is to have columns of eye(c) for targets, then multiplying the target for a single vector by a weight greater than 1 will improve its correct classification performance. In addition, if logsig or softmax is used, the estimated posterior will always be less than 1.

I haven’t weighted single vectors, just classes.

Notation: The term sample implies a group of data, not a single case or measurement.

Use patternnet with ‘logsig’ or ‘softmax’ as the output transfer function

For c classes use a target matrix that has columns of the c-dimensional unit matrix eye(c).

The relationships between the target matrix, integer (1:c) class index row vector, integer assigned class row vector, {0,1} error vector etc. are

target      = ind2vec(classind);
classind = vec2ind(target) % integers 1:c
net = train(net, input, target);
output = net(input);
assigned = vec2ind(output)
errors = (assigned ~= classind )
Nerr = sum(errors)

Individual class

SEE COMPLETE ANSWER CLICK THE LINK

https://www.matlabsolutions.com/resources/setting-sample-weights-for-training-of-network-to-set-the-.php

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet