<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:04:32 JST 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>PFS-JIRA</title>
    <link>https://pfspipe.ipmu.jp/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.3.4</version>
        <build-number>803005</build-number>
        <build-date>13-09-2019</build-date>
    </build-info>


<item>
            <title>[PIPE2D-1231] Reduce memory usage of fitPfsReferenceFlux</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-1231</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;I want to use PCA to reduce memory usage of fitPfsReferenceFlux.&lt;/p&gt;

&lt;p&gt;Though it takes several days with 500GB of memory&lt;br/&gt;
 to perform PCA on 6040 of 1e5-dimensional vectors (spectra), the program does finish,&lt;br/&gt;
 and it seems that the input 6040 vectors can be approximated by&lt;br/&gt;
 linear combinations of 1024 basis vectors with RMS relative errors 1.6e-4.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15654/15654_pcaresiduals.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The interpolator of flux models has been a function from the 4-dimensional parameter space&lt;br/&gt;
 (Teff, log(g), metal, alpha) to 1e5-dimensional vector space (R^4 &#8594; R^1e5).&lt;br/&gt;
 With PCA, I can replace it with a function R^4 &#8594; R^1024,&lt;br/&gt;
 &quot;R^1024&quot; being the set of coefficients in linear combinations of the 1024 basis vectors.&lt;/p&gt;

&lt;p&gt;I decide to use RBF to fit this function R^4 &#8594; R^1024.&lt;br/&gt;
 (Another candidate is polynomials, but I am not sure I would be able do without overfitting&lt;br/&gt;
 if I were to use polynomials.)&lt;/p&gt;

&lt;p&gt;I use the following procedure to estimate interpolation errors:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
For each x[i] of input ~6000 spectra:
    Make RBF from the input ~6000 spectra except x[i]
    Interpolate a spectrum y at the same parameter as x[i]
    rms[i] = sqrt(mean(square((y - x[i]) / x[i])))

error = sqrt(mean(square(rms)))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Below is the histogram of &quot;rms&quot; with the best hyperparameters. The RMS of &quot;rms&quot; is 2.6e-4&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15653/15653_rms.relative.error.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;I can see that the increase of errors from &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-1060&quot; title=&quot;Tune hyperparameters of fluxmodel interpolation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-1060&quot;&gt;&lt;del&gt;PIPE2D-1060&lt;/del&gt;&lt;/a&gt; is negligible.&lt;/p&gt;

&lt;p&gt;I want this new PCA-based interpolation merged to the master branch.&lt;br/&gt;
 This method will reduce memory usage to 1/6 of the current method.&lt;/p&gt;

&lt;p&gt;The new code requires a new version of fluxmodeldata, which I have uploaded here:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;-https://hscdata.mtk.nao.ac.jp/hsc_bin_dist/pfs/fluxmodeldata-ambre-20230602.tar.gz-&amp;#93;&lt;/span&gt;&lt;br/&gt;
 &lt;a href=&quot;https://hscdata.mtk.nao.ac.jp/hsc_bin_dist/pfs/fluxmodeldata-ambre-20230608.tar.gz&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://hscdata.mtk.nao.ac.jp/hsc_bin_dist/pfs/fluxmodeldata-ambre-20230608.tar.gz&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To use the new fluxmodeldata, users have to run &lt;tt&gt;./install.sh --prefix=/path/to/pfs-packages&#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;--set=small&amp;#93;&lt;/span&gt;&lt;/tt&gt; to&lt;br/&gt;
 pre-compute ~6,000 or ~60,000 spectra from the PCA basis vectors included in the package.&lt;/p&gt;</description>
                <environment></environment>
        <key id="23463">PIPE2D-1231</key>
            <summary>Reduce memory usage of fitPfsReferenceFlux</summary>
                <type id="3" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10518&amp;avatarType=issuetype">Task</type>
                                            <priority id="10000" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/medium.svg">Normal</priority>
                        <status id="10002" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="The issue is resolved, reviewed, and merged">Done</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="sogo.mineo">sogo.mineo</assignee>
                                    <reporter username="sogo.mineo">sogo.mineo</reporter>
                        <labels>
                            <label>flux-calibration</label>
                    </labels>
                <created>Mon, 5 Jun 2023 00:31:19 +0000</created>
                <updated>Fri, 16 Jun 2023 06:56:30 +0000</updated>
                            <resolved>Fri, 9 Jun 2023 00:08:49 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                <comments>
                            <comment id="32775" author="sogo.mineo" created="Mon, 5 Jun 2023 06:01:07 +0000"  >&lt;p&gt;Could you review this PR?&lt;/p&gt;</comment>
                            <comment id="32776" author="price" created="Tue, 6 Jun 2023 18:06:27 +0000"  >&lt;p&gt;The packaging for fluxmodeldata doesn&apos;t make much sense to me. &lt;tt&gt;install.py&lt;/tt&gt; doesn&apos;t actually do an installation, but it precomputes the data. Moreover, it puts the products in the same directory, not actually installing it anywhere. That means that if I want both &lt;tt&gt;small&lt;/tt&gt; and &lt;tt&gt;full&lt;/tt&gt; packages, I have to untar the tarball, rename the directory, and run the script in both. It&apos;s probably not worth fixing now, but for the next iteration it would be helpful to solve.&lt;/p&gt;</comment>
                            <comment id="32777" author="sogo.mineo" created="Wed, 7 Jun 2023 08:13:32 +0000"  >&lt;p&gt;I am making a new fluxmodeldata package whose &lt;tt&gt;install.py&lt;/tt&gt;&#160;actually installs files to &lt;tt&gt;PREFIX/fluxmodeldata-ambre-20230602-small&lt;/tt&gt; or &lt;tt&gt;PREFIX/fluxmodeldata-ambre-20230602-full&lt;/tt&gt; according to &lt;tt&gt;--set&lt;/tt&gt;&#160;option. (I will upload it tomorrow).&lt;/p&gt;

&lt;p&gt;I have made changes to the ticket branch (and reverted &lt;tt&gt;makeFluxModelInterpolator.py&lt;/tt&gt;) to keep supporting old fluxmodeldata packages. I have forgot to revise the commit message, but I don&apos;t have time to amend it today. Please give me comments, if any, on anything except the commit message.&lt;/p&gt;

&lt;p&gt;A question: I put &lt;tt&gt;@deprecated&lt;/tt&gt; decorator on &lt;tt&gt;makeFluxModelInterpolator()&lt;/tt&gt; function (in &lt;tt&gt;makeFluxModelInterpolator.py&lt;/tt&gt;) but no &lt;tt&gt;DeprecationWarning&lt;/tt&gt;&#160;is seen when the program is run. It seems to be python&apos;s (not &lt;tt&gt;deprecated&lt;/tt&gt;&apos;s) default behavior. What is the best way to inform the user of the deprecation? Should I use &lt;tt&gt;print()&lt;/tt&gt;?&lt;/p&gt;</comment>
                            <comment id="32781" author="sogo.mineo" created="Thu, 8 Jun 2023 06:36:10 +0000"  >&lt;p&gt;I uploaded the new fluxmodeldata package (&lt;a href=&quot;https://hscdata.mtk.nao.ac.jp/hsc_bin_dist/pfs/fluxmodeldata-ambre-20230608.tar.gz&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://hscdata.mtk.nao.ac.jp/hsc_bin_dist/pfs/fluxmodeldata-ambre-20230608.tar.gz&lt;/a&gt;), and inscribed this specific version in the deprecation messages in the sources. (For example,&#160;&quot;NaiveFluxModelInterpolator has been replaced by PCAFluxModelInterpolator, which requires fluxmodeldata &amp;gt;= ambre-20230608. See &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-1231&quot; title=&quot;Reduce memory usage of fitPfsReferenceFlux&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-1231&quot;&gt;&lt;del&gt;PIPE2D-1231&lt;/del&gt;&lt;/a&gt;.&quot;).&lt;/p&gt;

&lt;p&gt;I decide to let&#160;makeFluxModelInterpolator.py exit immediately if &lt;tt&gt;fluxmodeldata&lt;/tt&gt; is new, because it is not compatible with the new &lt;tt&gt;fluxmodeldata&lt;/tt&gt;. I keep makeFluxModelInterpolator.py only for old versions of &lt;tt&gt;fluxmodeldata&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="32786" author="sogo.mineo" created="Fri, 9 Jun 2023 00:08:49 +0000"  >&lt;p&gt;Merged. Thanks for reviewing.&lt;/p&gt;</comment>
                            <comment id="33199" author="price" created="Wed, 14 Jun 2023 21:59:49 +0000"  >&lt;p&gt;I just tried installing the new fluxmodeldata package, and it was much smoother, thanks! &lt;del&gt;The only problem I&apos;ve found so far is that the &lt;tt&gt;ups&lt;/tt&gt; directory isn&apos;t installed.&lt;/del&gt;&lt;/p&gt;</comment>
                            <comment id="33200" author="price" created="Wed, 14 Jun 2023 22:12:50 +0000"  >&lt;p&gt;Ah, no! I wasn&apos;t aware that the package name was added to the prefix, so everything was installed down a level.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="23577">PIPE2D-1238</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="23262">PIPE2D-1168</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="22872">PIPE2D-1060</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="15654" name="pcaresiduals.png" size="67327" author="sogo.mineo" created="Mon, 5 Jun 2023 00:16:03 +0000"/>
                            <attachment id="15653" name="rms.relative.error.png" size="31696" author="sogo.mineo" created="Mon, 5 Jun 2023 00:22:57 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|zzsxav:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10100" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Reviewers</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>price</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>