From owner-help-octave at bevo dot che dot wisc dot edu Tue Apr 8 11:20:23 1997 Subject: Re: Segmentation fault From: "Juan I. Arribas" To: Friedrich Leisch CC: help-octave at che dot utexas dot edu Date: Tue, 08 Apr 1997 18:19:48 +0200 This is a multi-part message in MIME format. --------------172CBC1F5462C12D5CF10BE6 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by rocinante.tel.uva.es id SAA15583 Friedrich Leisch wrote: > hope you appreciate some suggestions by me, too ;-) >=20 > 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 ... >=20 > best, > fritz >=20 > -- > --------------------------------------------------------------------- > Friedrich Leisch > Institut f=FCr Statistik Tel: (+43 1) 58801 4541 > Technische Universit=E4t Wien Fax: (+43 1) 504 14 98 > Wiedner Hauptstra=DFe 8-10/1071 Friedrich dot Leisch at ci dot tuwien dot ac dot at > 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.=20 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 =20 Juan I. Arribas Dept. of Teoria de la Senal,Comunicaciones e Ingenieria Telematica Universidad de Valladolid Valladolid, SPAIN --------------172CBC1F5462C12D5CF10BE6 Content-Type: text/plain; charset=us-ascii; name="delta.m" Content-Disposition: inline; filename="delta.m" Content-Transfer-Encoding: 7bit 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 --------------172CBC1F5462C12D5CF10BE6 Content-Type: text/plain; charset=us-ascii; name="logsig.m" Content-Disposition: inline; filename="logsig.m" Content-Transfer-Encoding: 7bit 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 --------------172CBC1F5462C12D5CF10BE6--