|
From: | Wilson de Oliveira |
Subject: | Re: Netlab on Octave |
Date: | Fri, 11 Sep 2009 17:56:25 -0300 |
Hello Wilson de Oliveira
Unfortunately Octave does not support GUI graphic control.
--- Wilson de Oliveira wrote:
> Ok. Sorry.
> For a start, Netlab is a Matlab toolbox for Pattern Recognition which
> includes amongst others models Neural Networks. It is freely available at:
> http://www.ncrg.aston.ac.uk/netlab/index.php
> demnlab.m is a demonstration program which runs several models in gui
> interface.
>
> As regard the version of the octave, thanks for your help! The octave 3.0.0
> came with qtoctave - a gui interface for octave; Now that I´ve installed the
> 3.2.2 version available at sourceforge.net I got fewer errors:
>
> > demnlab
> error: `uicontrol' undefined near line 33 column 3
> error: called from:
> error: C:\Octave\Netlab\demnlab.m at line 33, column 3
> octave-3.2.2.exe:6:C:\Octave\Netlab
> >
>
> Thanks for your help
> Wilson de Oliveira
> UFRPE-DEInfo
> http://www.cin.ufpe.br/~wrdo
>
>
You should control graphics with graphic handle functions.
Please see section 15 "Plotting" in octave manual.
You should read care fully "15.1 Plotting Basics" band "15.2 Advanced Plotting".
Perhaps these types functions are compatible to MATLAB.
I have tried a simple example in web page.
ndata=20
% Generate the matrix of inputs x and targets t.
x = [0:1/19:1]';
t = sin(2*pi*x) + 0.2*randn(ndata, 1);
% Set up network parameters.
net = mlp(1, 3, 1, 'linear')
net =
{
type = mlp
nin = 1
nhidden = 3
nout = 1
nwts = 10
outfn = linear
w1 =
-1.148633 1.104356 0.049478
b1 =
-0.070054 0.902782 1.349561
w2 =
0.17895
0.27658
0.36492
b2 = 0.66142
}
****************
% Set up vector of options for the optimiser.
options = zeros(1,18);
options(1) = 1;
options(9) = 1;
options(14) = 100;
% Train using scaled conjugate gradients.
[net, options] = netopt(net, options, x, t, 'scg');
error: `fcnchk' undefined near line 68 column 5
error: called from:
error: D:\usr\Tatsu\program\Octave\netlab\scg.m at line 68, column 3
error: D:\usr\Tatsu\program\Octave\netlab\netopt.m at line 36, column 17
Octave does not support `fcnchk'
But I found
http://en.wikibooks.org/wiki/MATLAB_Programming/Differences_between_Octave_and_MATLAB
********
If something (like Netlab) need a function called fcnchk you can just put the following into a file
called fcnchk.m and put it somewhere Octave can find it:
function f=fcnchk(x, n)
f = x;
end
********
I placed fcnchk.m under the same folder of netlab
SO I get
Checking gradient ...
analytic diffs delta
1.1904e+000 1.1904e+000 -1.3890e-009
4.8963e-001 4.8963e-001 8.2556e-010
1.1238e+000 1.1238e+000 -5.8918e-010
2.3292e+000 2.3292e+000 -1.3039e-010
1.1362e+000 1.1362e+000 -1.2848e-009
1.8523e+000 1.8523e+000 6.3412e-010
-1.3883e+001 -1.3883e+001 -1.9210e-010
2.0438e+001 2.0438e+001 5.2320e-010
1.9960e+001 1.9960e+001 -9.0928e-011
2.2659e+001 2.2659e+001 -8.4377e-010
Cycle 1 Error 4.629483 Scale 1.000000e+000
Cycle 2 Error 4.629483 Scale 5.000000e-001
Cycle 3 Error 4.629483 Scale 2.000000e+000
Cycle 4 Error 4.259136 Scale 8.000000e+000
Cycle 5 Error 4.050134 Scale 4.000000e+000
Cycle 6 Error 3.775366 Scale 2.000000e+000
Cycle 7 Error 3.390233 Scale 2.000000e+000
Cycle 8 Error 3.288238 Scale 1.000000e+000
Cycle 9 Error 3.286530 Scale 5.000000e-001
Cycle 10 Error 3.235898 Scale 2.500000e-001
Cycle 11 Error 3.212532 Scale 1.250000e-001
Cycle 12 Error 3.192542 Scale 6.250000e-002
Cycle 13 Error 3.187294 Scale 3.125000e-002
:
:
*****************************************
% Plot the trained network predictions.
plotvals = [0:0.01:1]';
y = mlpfwd(net, plotvals);
plot(plotvals, y, 'ob')
gives a plot like attatchment files.
********
Honestly I am not familiar with this type of work.
In addition, I have no experience of MATLAB
Hopefully users who use both MATLAB and octave give you much better suggestions.
The aboves are all what I can do for you.
Good luck!!
Regards
Tatsuro
--------------------------------------
Thanks 10 years! Yahoo! Shopping and Yahoo! Auctions
http://pr.mail.yahoo.co.jp/ec10years/
[Prev in Thread] | Current Thread | [Next in Thread] |