<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic what is the structure of fjac vector for dtrnlsp_solve? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856587#M7043</link>
    <description>Hello. I am trying to use dtrnlsp_solve function, but I do not know the format of fjac. I calculate fjac myself. According to the manual, it is a 1D array of size m*n where m is the number of function values and n is the number of variables. But, the manual does not say how the fjack elements are arranged. There are two possible ways:&lt;BR /&gt;&lt;BR /&gt;for(i=0;i&lt;M&gt;/dx&lt;J&gt;;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;for(j=0;j&lt;N&gt;/dx&lt;J&gt;;&lt;BR /&gt;&lt;BR /&gt;Which one is correct?&lt;BR /&gt;&lt;/J&gt;&lt;/N&gt;&lt;/J&gt;&lt;/M&gt;</description>
    <pubDate>Mon, 13 Jul 2009 20:48:49 GMT</pubDate>
    <dc:creator>gpwr9k5</dc:creator>
    <dc:date>2009-07-13T20:48:49Z</dc:date>
    <item>
      <title>what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856587#M7043</link>
      <description>Hello. I am trying to use dtrnlsp_solve function, but I do not know the format of fjac. I calculate fjac myself. According to the manual, it is a 1D array of size m*n where m is the number of function values and n is the number of variables. But, the manual does not say how the fjack elements are arranged. There are two possible ways:&lt;BR /&gt;&lt;BR /&gt;for(i=0;i&lt;M&gt;/dx&lt;J&gt;;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;for(j=0;j&lt;N&gt;/dx&lt;J&gt;;&lt;BR /&gt;&lt;BR /&gt;Which one is correct?&lt;BR /&gt;&lt;/J&gt;&lt;/N&gt;&lt;/J&gt;&lt;/M&gt;</description>
      <pubDate>Mon, 13 Jul 2009 20:48:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856587#M7043</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-13T20:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856588#M7044</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hello. I am trying to use dtrnlsp_solve function, but I do not know the format of fjac. I calculate fjac myself. According to the manual, it is a 1D array of size m*n where m is the number of function values and n is the number of variables. But, the manual does not say how the fjack elements are arranged. There are two possible ways:&lt;BR /&gt;&lt;BR /&gt;for(i=0;i&lt;M&gt;/dx&lt;J&gt;;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;for(j=0;j&lt;N&gt;/dx&lt;J&gt;;&lt;BR /&gt;&lt;BR /&gt;Which one is correct?&lt;BR /&gt;&lt;/J&gt;&lt;/N&gt;&lt;/J&gt;&lt;/M&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Hi,&lt;BR /&gt;&lt;BR /&gt;The Fortran version is an array FJac(m,n), so I believe it goes the same as with other two-dimensional matrix A of size m x n stored densely in a one-dimensional array:&lt;BR /&gt;A&lt;I&gt;&lt;J&gt; = B[i*n+j] in C (i=0, ... , m-1, j=0, ... , n-1)&lt;BR /&gt;A(i,j) = B(j*m+i) in Fortran (i=1, ... , m, j=1, ... , n).&lt;BR /&gt;&lt;BR /&gt;so this would be your first version. See Chapter 7 of User's Manual.&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;&lt;/J&gt;&lt;/I&gt;</description>
      <pubDate>Tue, 14 Jul 2009 00:36:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856588#M7044</guid>
      <dc:creator>ArturGuzik</dc:creator>
      <dc:date>2009-07-14T00:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856589#M7045</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/342379"&gt;ArturGuzik&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Hi,&lt;BR /&gt;&lt;BR /&gt;The Fortran version is an array FJac(m,n), so I believe it goes the same as with other two-dimensional matrix A of size m x n stored densely in a one-dimensional array:&lt;BR /&gt;A&lt;I&gt;&lt;J&gt; = B[i*n+j] in C (i=0, ... , m-1, j=0, ... , n-1)&lt;BR /&gt;A(i,j) = B(j*m+i) in Fortran (i=1, ... , m, j=1, ... , n).&lt;BR /&gt;&lt;BR /&gt;so this would be your first version. See Chapter 7 of User's Manual.&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;&lt;/J&gt;&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Thanks. That is what I have been using. Something does not work. The solver keeps exiting with 0 iterations and st_cr=6. I tried different values of rs and even changed the sign of jacobian, but still the same result. If I set eps[5]=0 to avoid early exit, then initialization fails. If you can advice on how to avoid early exit with st_cr=6, that would be great.&lt;BR /&gt;Thanks again.</description>
      <pubDate>Tue, 14 Jul 2009 00:51:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856589#M7045</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-14T00:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856590#M7046</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Thanks. That is what I have been using. Something does not work. The solver keeps exiting with 0 iterations and st_cr=6. I tried different values of rs and even changed the sign of jacobian, but still the same result. If I set eps[5]=0 to avoid early exit, then initialization fails. If you can advice on how to avoid early exit with st_cr=6, that would be great.&lt;BR /&gt;Thanks again.&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Well, sounds as problems with initialization/settings.&lt;BR /&gt;&lt;BR /&gt;(1) does MKL example (from disk) work for you?&lt;BR /&gt;&lt;BR /&gt;(2) show a bit more of _init call, so we can take a look.&lt;BR /&gt;&lt;BR /&gt;str_cr = 6 means that solution converged, so maybe you have a FJac zero(s) or ..... Do you call it properly (handle, pointers etc)?&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jul 2009 01:05:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856590#M7046</guid>
      <dc:creator>ArturGuzik</dc:creator>
      <dc:date>2009-07-14T01:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856591#M7047</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/342379"&gt;ArturGuzik&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Well, sounds as problems with initialization/settings.&lt;BR /&gt;&lt;BR /&gt;(1) does MKL example (from disk) work for you?&lt;BR /&gt;&lt;BR /&gt;(2) show a bit more of _init call, so we can take a look.&lt;BR /&gt;&lt;BR /&gt;str_cr = 6 means that solution converged, so maybe you have a FJac zero(s) or ..... Do you call it properly (handle, pointers etc)?&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;The example from disk works, saying "PASS". I am using this solver to train a neural network. I just copied the example code and changed everything that was related to my task. From what I see, all handles and variables get set correctly. Jacobian is not zero. dtrnlsp_solve computes the starting and ending residuals and they are the same. I compute the same rezidual myself (as mySSE in the code below) and it is way different.&lt;BR /&gt;
&lt;PRE&gt;[cpp]double NN::train(double **in,double *tgt,int nep,const double maxSSE)
{
	int nit1=1000;			// maximum number of iterations
	int nit2=100;			// maximum number of iterations of calculation of trial-step
	double rs=1.0;			// initial step bound
	double eps[6];			// precisions for stop-criteria
	int RCI_Request;		// reverse communication interface variable
	int successful;			// rci cycle variable
	int nit;				// number of iterations performed
	int st_cr;				// number of stop-criterion
	double init_sse,sse;	// initial and final sse's
	_TRNSP_HANDLE_t handle;	// TR solver handle

//	set precisions for stop-criteria
	for(int i=0;i&amp;lt;6;i++) eps&lt;I&gt;=1.0e-30;
	cout &amp;lt;&amp;lt; np &amp;lt;&amp;lt; endl;

//	initialize solver (allocate memory, set initial values)
	if(dtrnlsp_init(&amp;amp;handle,&amp;amp;nw,&amp;amp;np,wv,eps,&amp;amp;nit1,&amp;amp;nit2,&amp;amp;rs) != TR_SUCCESS)
	{
		cout &amp;lt;&amp;lt; "error in dtrnlsp_initn";
		cin.get();
		return 0;
	}

//	set initial rci cycle variables
	RCI_Request = 0;
	successful = 0;
	double mySSE=0.0;

//	main training cycle
	while(successful == 0)
	{
	//	call tr solver, which reurns RCI_request telling us the next step
		if (dtrnlsp_solve(&amp;amp;handle,err,jac,&amp;amp;RCI_Request) != TR_SUCCESS)
		{
			cout &amp;lt;&amp;lt; "error in dtrnlsp_solven";
			cin.get();
			return 0;
		}

	//	act on RCI_request
		if (RCI_Request == -1 || RCI_Request == -2 || RCI_Request == -3 || 
			RCI_Request == -4 || RCI_Request == -5 || RCI_Request == -6)
			successful = 1; // one of the eps is below maxSSE; exit rci cycle
		if (RCI_Request == 1)
		{
		//	recalculate errors
			for(int p=0;p [/cpp]&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jul 2009 04:22:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856591#M7047</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-14T04:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856592#M7048</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;/EM&gt;&lt;PRE&gt;&lt;EM&gt;[cpp]double NN::train(double **in,double *tgt,int nep,const double maxSSE)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;//	initialize solver (allocate memory, set initial values)&lt;BR /&gt;	if(dtrnlsp_init(&amp;amp;handle,&amp;amp;nw,&amp;amp;np,wv,eps,&amp;amp;nit1,&amp;amp;nit2,&amp;amp;rs) != TR_SUCCESS)&lt;BR /&gt;&lt;BR /&gt;[/cpp]&lt;/EM&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Quick look -- nothing suspicious. Where do you get/set nw, np, that is sizes of the problem/arrays (used in _init).&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jul 2009 05:30:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856592#M7048</guid>
      <dc:creator>ArturGuzik</dc:creator>
      <dc:date>2009-07-14T05:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856593#M7049</link>
      <description>&lt;DIV style="margin:0px;"&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I would like to recommend to change the precisions: for(int i=0;i&amp;lt;6;i++) eps&lt;I&gt;=1.0e-30; &lt;BR /&gt;&lt;/I&gt;&lt;/DIV&gt;
I suggest to use 1.0e-12 or large.&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;--Nikita&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jul 2009 08:11:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856593#M7049</guid>
      <dc:creator>Nikita_S_Intel</dc:creator>
      <dc:date>2009-07-14T08:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856594#M7050</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/342379"&gt;ArturGuzik&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Quick look -- nothing suspicious. Where do you get/set nw, np, that is sizes of the problem/arrays (used in _init).&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I passthem when I call my train() function. nw=71 (number of weoghts/variables), np=1500 (number of patterns/functions). So, my fjac array is huge, 71x1500=106,500. Could that be a problem? I tried to increase esp[] to 1e-12, but now it quits with st_cr=2. My biggest puzzle is why the initial and final residuals computed by the solver are the same and so different from mine. I pass the solver thevalues err&lt;P&gt;=tgt&lt;/P&gt;&lt;P&gt;-out&lt;/P&gt;&lt;P&gt; as the function values. I compute an SSE as sum(err&lt;/P&gt;&lt;P&gt;^2,p=0..np-1). The solver probably uses something else. For instance, solver computes 42.9975. I compute 77431.3. Even if I divide my sse by (np) or (2*np), I still get a different residual that the solver's. How does the solver computes the residual from the passed function values?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2009 15:37:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856594#M7050</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-14T15:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856595#M7051</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;I passthem when I call my train() function. nw=71 (number of weoghts/variables), np=1500 (number of patterns/functions). So, my fjac array is huge, 71x1500=106,500. Could that be a problem? I tried to increase esp[] to 1e-12, but now it quits with st_cr=2. My biggest puzzle is why the initial and final residuals computed by the solver are the same and so different from mine. I pass the solver thevalues err&lt;P&gt;=tgt&lt;/P&gt;&lt;P&gt;-out&lt;/P&gt;&lt;P&gt; as the function values. I compute an SSE as sum(err&lt;/P&gt;&lt;P&gt;^2,p=0..np-1). The solver probably uses something else. For instance, solver computes 42.9975. I compute 77431.3. Even if I divide my sse by (np) or (2*np), I still get a different residual that the solver's. How does the solver computes the residual from the passed function values?&lt;/P&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Jul 2009 16:02:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856595#M7051</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-14T16:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856596#M7052</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Hi,&lt;BR /&gt;&lt;BR /&gt;see &lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=66851"&gt;this thread&lt;/A&gt;. You pass the residual. The docs are misleading.&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Jul 2009 00:17:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856596#M7052</guid>
      <dc:creator>ArturGuzik</dc:creator>
      <dc:date>2009-07-15T00:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856597#M7053</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
And one more, your Jac is 1500 x 71, not 71 x 1500, right?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Jul 2009 00:46:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856597#M7053</guid>
      <dc:creator>ArturGuzik</dc:creator>
      <dc:date>2009-07-15T00:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856598#M7054</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/342379"&gt;ArturGuzik&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;And one more, your Jac is 1500 x 71, not 71 x 1500, right?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;A.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Number of function values m=1500&lt;BR /&gt;Number of variables n=71.&lt;BR /&gt;My jac is a 1D array oflength 21,300 computed as jac[i*n+j]=dFunction&lt;J&gt;/dVariable&lt;J&gt;, i=0..m-1, j=0..n-1&lt;BR /&gt;I got the residuals to agree with my calculations: r1/2=sqrt(Function&lt;J&gt;^2,j=0..m-1).&lt;BR /&gt;I changed the m from 1500 to 300 and still got stopped with st_cr=6. All eps[]=1e-30. I checked my jac values and their magnituderanges from 1e-6 to 1.&lt;BR /&gt;Here is the whole code of the function, that is doing all calculations (nw=n - number of variables, np=m - number of function values, err&lt;P&gt;, p=0,..,np-1 - evaluated function, which = tgt&lt;/P&gt;&lt;P&gt;-Function_Output)&lt;BR /&gt;
&lt;PRE&gt;[cpp]double NN::train(double **in,double *tgt,int nep,const double maxSSE)
{
	int nit1=1000;			// maximum number of iterations
	int nit2=100;			// maximum number of iterations of calculation of trial-step
	double rs=1.0;			// initial step bound
	double eps[6];			// precisions for stop-criteria
	int RCI_Request;		// reverse communication interface variable
	int successful;			// rci cycle variable
	int nit;				// number of iterations performed
	int st_cr;				// number of stop-criterion
	double init_sse,sse;	// initial and final sse's
	_TRNSP_HANDLE_t handle;	// TR solver handle

//	set precisions for stop-criteria
	for(int i=0;i&amp;lt;6;i++) eps&lt;I&gt;=1.0e-50;

//	initialize solver (allocate memory, set initial values)
	if(dtrnlsp_init(&amp;amp;handle,&amp;amp;nw,&amp;amp;np,wv,eps,&amp;amp;nit1,&amp;amp;nit2,&amp;amp;rs) != TR_SUCCESS)
	{
		cout &amp;lt;&amp;lt; "error in dtrnlsp_initn";
		cin.get();
		return 0;
	}

//	set initial rci cycle variables
	RCI_Request = 0;
	successful = 0;
	double mySSE;

//	main training cycle
	while(successful == 0)
	{
	//	call tr solver, which reurns RCI_request telling us the next step
		if (dtrnlsp_solve(&amp;amp;handle,err,jac,&amp;amp;RCI_Request) != TR_SUCCESS)
		{
			cout &amp;lt;&amp;lt; "error in dtrnlsp_solven";
			cin.get();
			return 0;
		}

	//	act on RCI_request
		if (RCI_Request == -1 || RCI_Request == -2 || RCI_Request == -3 || 
			RCI_Request == -4 || RCI_Request == -5 || RCI_Request == -6)
			successful = 1; // one of the eps is below maxSSE; exit rci cycle
		if (RCI_Request == 1)
		{
		//	recalculate errors
			mySSE=0.0;
			for(int p=0;p &amp;lt; np;p++)					// for each training pattern
			{
				ffwd(in&lt;/I&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;);
				err&lt;/P&gt;&lt;P&gt;=tgt&lt;/P&gt;&lt;P&gt;-out[nl-1][0];	// only one neuron in the output layer
				mySSE+=err&lt;/P&gt;&lt;P&gt;*err&lt;/P&gt;&lt;P&gt;;
			}
		}
		if (RCI_Request == 2)
		{
		//	compute Jacobi matrix
			cout &amp;lt;&amp;lt; "compute Jacobiann";
			for(int p=0;p &amp;lt; np;p++)					// for each training pattern
			{
			//	update outputs of each neuron
				ffwd(in&lt;/P&gt;&lt;P&gt;);

			//	find sensitivity for the output layer i=nl-1
				s[nl-1][0]=-1.0;
				if(oaf==1)
					s[nl-1][0]*=afDeriv(out[nl-1][0]);

			//	propagate sensitivities from output layer to hidden layers	
				for(int i=nl-2;i &amp;gt; 0;i--)				// for each layer except input &amp;amp; output
					for(int j=0;j &amp;lt; ls&lt;I&gt;;j++)		// for each neuron in current layer
					{
						double sum=0.0;
						for(int k=0;k &amp;lt; ls[i+1];k++)	// for each neuron in later layer
							sum+=s[i+1]&lt;K&gt;*w[i+1]&lt;K&gt;&lt;J&gt;;
						s&lt;I&gt;&lt;J&gt;=afDeriv(out&lt;I&gt;&lt;J&gt;)*sum;
					}

			//	compute gradients: jac&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/K&gt;&lt;/K&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;[iw]=derr&lt;/P&gt;&lt;P&gt;/dw&lt;I&gt;&lt;J&gt;&lt;K&gt;=s&lt;I&gt;&lt;J&gt;*out[i-1]&lt;K&gt;
				int iw=0;
				for(int i=1;i &amp;lt; nl;i++)					// for each layer except input
					for(int j=0;j &amp;lt; ls&lt;I&gt;;j++)			// for each neuron in current layer
						for(int k=0;k &amp;lt;= ls[i-1];k++)		// for each input of curr neuron incl bias
						{
							if(k==ls[i-1]) jac[p*nw+iw]=s&lt;I&gt;&lt;J&gt;;		// bias input
							else jac[p*nw+iw]=s&lt;I&gt;&lt;J&gt;*out[i-1]&lt;K&gt;;	// data input
							if(p*nw+iw&amp;gt;=21100) 
								cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; j &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; k &amp;lt;&amp;lt; ": " &amp;lt;&amp;lt; jac[p*nw+iw] &amp;lt;&amp;lt; endl;
							iw++;
						}
			}
		}
	}

// get solution statuse
	if (dtrnlsp_get(&amp;amp;handle,&amp;amp;nit,&amp;amp;st_cr,&amp;amp;init_sse,&amp;amp;sse) != TR_SUCCESS)
	{
		cout &amp;lt;&amp;lt; "error in dtrnlsp_getn";
		cin.get();
		return 0;
	}

//	free handle memory
	if (dtrnlsp_delete(&amp;amp;handle) != TR_SUCCESS)
	{
		cout &amp;lt;&amp;lt; "error in dtrnlsp_deleten";
		cin.get();
		return 0;
	}
	cout &amp;lt;&amp;lt; "finished after " &amp;lt;&amp;lt; nit &amp;lt;&amp;lt; " iterationsn";
	cout &amp;lt;&amp;lt; "stop criterion is " &amp;lt;&amp;lt; st_cr &amp;lt;&amp;lt; endl;
	cout &amp;lt;&amp;lt; "sse: " &amp;lt;&amp;lt; init_sse &amp;lt;&amp;lt; " -&amp;gt; " &amp;lt;&amp;lt; sse &amp;lt;&amp;lt; endl;
	cout &amp;lt;&amp;lt; "mySSE: " &amp;lt;&amp;lt; sqrt(mySSE) &amp;lt;&amp;lt; endl;
	return(sse);
}[/cpp]&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/I&gt;&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;&lt;/J&gt;&lt;/J&gt;&lt;/J&gt;</description>
      <pubDate>Wed, 15 Jul 2009 14:00:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856598#M7054</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-15T14:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: what is the structure of fjac vector for dtrnlsp_solve?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856599#M7055</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;I think I found my mistake&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Jul 2009 21:36:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/what-is-the-structure-of-fjac-vector-for-dtrnlsp-solve/m-p/856599#M7055</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-15T21:36:54Z</dc:date>
    </item>
  </channel>
</rss>

