Comments (4)
Hi, I think that this may be little bit complicated because the derivatives are collected over a batch inside the e.g. vl_nnconv.cu... So you would probably need to change the mex files and have adjustable alpha
parameter in the sgemm operation for the backrpop (e.g. on line 820 in vl_nnconv.cu but on many more places too...).
But if you want to just have a proof of concept, and you don't mind that the computation would take longer, you can pass batches of size 1 and then integrate the gradients in Matlab... Simplest would be to have your own version of vl_simplenn
which would iterate over all images in a batch summing up the derivatives...
from matconvnet.
Hmm, just realised that I might have been wrong about this - you just need to change the softmaxloss function implementation to weight the loss per learning example... [feeling stupid]
from matconvnet.
How would I go about changing the softmaxloss function to weigh the examples?
I would adapt lines 59-60 as follows, where the weights vector is based on the label vector c:
t = Xmax + log(sum(ex,3)) - reshape(X(c_), [sz(1:2) 1 sz(4)]) ;
t = t .* weights;
Y = sum(t(:)) / n ;
But what about the backward step?
from matconvnet.
I also have this problem. After changing the softmaxloss function to weight the examples, how to change the backpropagation steps?
I have tried it if nothing is done, that would cause NaNs and no regression.
from matconvnet.
Related Issues (20)
- vl_compilenn('enableGpu', true)
- Command failed while compiling MatConvNet HOT 1
- Visual Studio compiling: DagNN.mex
- Latest versions vl_compilenn fail
- vl_compilenn directory
- Error in vl_testnn('gpu', true). MATLAB: mex: ErrInvalidMEXFile
- Error vl_compilenn('enableGpu', true) HOT 1
- cuda11.1 HOT 1
- 未定义的函数 'vl_testnn'
- this is why
- D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(89): error: identifier "cudnnConvolutionFwdPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(94): error: identifier "cudnnConvolutionBwdFilterPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(99): error: identifier "cudnnConvolutionBwdDataPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(141): error: identifier "cudnnConvolutionFwdPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(147): error: identifier "cudnnConvolutionBwdFilterPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(153): error: identifier "cudnnConvolutionBwdDataPreference_t" is undefined 6 errors detected in the compilation of "D:/Software/matconvnet-1.0-beta25/matlab/src/bits/data.cu". HOT 1
- every time i reopen the matlab porject,need to recompile the matconvnet,why?
- Question about the matrix format of vgg19
- Error in vl_compilenn>mex_compile (line 583) and vl_compilenn (line 492) HOT 1
- How to solve?
- The NVCC compiler 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc' does not appear to be valid. HOT 1
- Issue when compiling with GPU enabled HOT 1
- error in vl_compilenn HOT 1
- Is vl_nnconv implemented based on the FFT operator? HOT 1
- Convert pytorch model to matconvnet model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matconvnet.