Segmentation fault

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Segmentation fault

Juan I. Arribas
I have recently installed Octave on my linux 2.0.0. I think that I have
a problem when calling for my .m (using function) files many times
inside a simulation program for Neural Networks. Octave gives me
the following error message:

error: Segmentation fault -- stopping myself ...
and the octave exits to the sell.

Does anyone know how can I solve this problem? I would be very
appreciated for any suggestion, thankyou very much



                                Juan I. Arribas
                                Dept. of Teoria de la Senal,         Comunicaciones e
Ingenieria Telematica
                                Universidad de Valladolid
                                Valladolid, SPAIN

Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault

Friedrich Leisch-3
>>>>> On Tue, 08 Apr 1997 17:02:30 +0200,
>>>>> Juan I Arribas wrote:

> I have recently installed Octave on my linux 2.0.0. I think that I have
> a problem when calling for my .m (using function) files many times
> inside a simulation program for Neural Networks. Octave gives me
> the following error message:

> error: Segmentation fault -- stopping myself ...
> and the octave exits to the sell.

> Does anyone know how can I solve this problem? I would be very
> appreciated for any suggestion,

hope you appreciate some suggestions by me, too ;-)

anyway, to get started you should include some code (causing the
problem) into a help request, simply saying `I get a seg fault' is not
very informative ...

best,
fritz

--
---------------------------------------------------------------------
                         Friedrich  Leisch                            
 Institut für Statistik                      Tel: (+43 1) 58801 4541
 Technische Universität Wien                 Fax: (+43 1)  504 14 98
 Wiedner Hauptstraße 8-10/1071      [hidden email]
 A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch
      PGP public key http://www.ci.tuwien.ac.at/~leisch/pgp.key
---------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault

Juan I. Arribas
In reply to this post by Juan I. Arribas
Wesley Darlington wrote:

>
> Dear Juan,
>
> I found with octave 1.x.x that calling `f.m' rather
> than just `f' caused a segfault. I have octave 2.0.5,
> and it doesn't seem to be a problem here, but perhaps
> it is with 2.0.0?
>
> Anyway, my only suggestion (feeble though it is) is
> to check that you call the function `my' with `my'
> rather than `my.m'.
>
> Regards,
> Wesley Darlington,
> Dept. Applied Maths,
> Queen's University of Belfast.

Dear Wesley,
                it is true what you tell me, but the problem I have
happends inside a function, which I invoke without the .m from Octave´s
prompt (as you tell me to do) when calling for another two functions
many many times (in particular delta.m and logsig.m which I will attach
in another e-mail in reply to Mr. Leisch) inside an iterative algorithm
for NN´s simulation (I call for them over 10*10*15*20000= 30 million
times). In fact if I omit the call to these two functions, the program
runs till the end perfectly.


Thanyou so much for your fast help, my regards


  Juan Ignacio Arribas
                                 Dept. of Teoria de la
Senal,                                             Comunicaciones e
Ingenieria Telematica
                                 Universidad de Valladolid
                                 Valladolid, SPAIN

Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault

Juan I. Arribas
In reply to this post by Friedrich Leisch-3
Friedrich Leisch wrote:

> hope you appreciate some suggestions by me, too ;-)
>
> anyway, to get started you should include some code (causing the
> problem) into a help request, simply saying `I get a seg fault' is not
> very informative ...
>
> best,
> fritz
>
> --
> ---------------------------------------------------------------------
>                          Friedrich  Leisch
>  Institut für Statistik                      Tel: (+43 1) 58801 4541
>  Technische Universität Wien                 Fax: (+43 1)  504 14 98
>  Wiedner Hauptstraße 8-10/1071      [hidden email]
>  A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch
>       PGP public key http://www.ci.tuwien.ac.at/~leisch/pgp.key
> ---------------------------------------------------------------------

Dear Friedrich,
                here they are, the two functions in files .m which I
think are causing me the problem: delta.m and logsig.m. They are both
called for around 30 million times from the inner part of a for
statement inside another function file.
My octave is version 1.1.1 (binary distribution) on a 2.0.0 Linux
Kernel.

I am thinking on writing the contents of both files explic inside the
general function which now calls them, to avoid calling them for so many
times.

Hope you have enough information now to properly answer me, I appreciate
your efforts, thankyou very much


best
                                 
                                 Juan I. Arribas
                                 Dept. of Teoria de la
Senal,Comunicaciones e Ingenieria Telematica
                                 Universidad de Valladolid
                                 Valladolid, SPAIN

function delta=delta(d,y,BETA)


if d==0
        delta=(-1).*y.^(2-BETA).*(1-y).^(1-BETA);

else
         delta=y.^(1-BETA).*(1-y).^(2-BETA);

endif

endfunction

function a = logsig(n,b)
%LOGSIG Log sigmoid transfer function.
%
% LOGSIG(N)
%  N - SxQ Matrix of net input (column) vectors.
% Returns the values of N squashed between 0 and 1.
%
% EXAMPLE: n = -10:0.1:10;
%         a = logsig(n);
%         plot(n,a)
%
% LOGSIG(Z,B) ...Used when Batching.
%  Z - SxQ Matrix of weighted input (column) vectors.
%  B - Sx1 Bias (column) vector.
% Returns the squashed net input values found by adding
%  B to each column of Z.
%
% LOGSIG('delta') returns name of delta function.
% LOGSIG('init') returns name of initialization function.
% LOGSIG('name') returns full name of this transfer function.
% LOGSIG('output') returns output range of this function.
%
% See also NNTRANS, BACKPROP, NWTAN, LOGSIG.

% Mark Beale, 1-31-92
% Revised 12-15-93, MB
% Copyright (c) 1992-94 by The MathWorks, Inc.
% $Revision: 1.1 $  $Date: 1994/01/11 16:25:39 $

if nargin < 1, error('Note enough arguments.'); endif

if isstr(n)
  if strcmp(lower(n),'delta')
    a = 'deltalog';
  elseif strcmp(lower(n),'init')
    a = 'nwlog';
  elseif strcmp(lower(n),'name')
    a = 'Log Sigmoid';
  elseif strcmp(lower(n),'output')
    a = [0 1];
  else
    error('Unrecognized property.')
  endif
else
  if nargin==2
    [nr,nc] = size(n);
    n = n + b*ones(1,nc);
  endif
  a = 1 ./ (1+exp(-n));
  i = find(~finite(a));
  a(i) = sign(n(i))*0.5 + 0.5;
        return;
endif

endfunction
Reply | Threaded
Open this post in threaded view
|

Re: Segmentation fault

John W. Eaton-6
On  8-Apr-1997, Juan I. Arribas <[hidden email]> wrote:

| My octave is version 1.1.1 (binary distribution) on a 2.0.0 Linux
| Kernel.

Now we are getting somewhere.  Octave 1.1.1 is ancient.  You should
get a copy of version 2.0.5.  Source and binaries are available from
ftp://ftp.che.wisc.edu/pub/octave.

Also, if Octave crashes, for any reason at all, it is a bug.  You
should report it to [hidden email].  Please read the
chapter in the Octave manual about reporting bugs to find out what
information you need to include so that the bug can be fixed.

Thanks,

jwe