Harry-Westwood / Y4-Project-InterNeuralStellar

Bayesian Hierarchical Modelling and Machine Learning of Stellar Populations
1 stars 0 forks source link

Reporting the first "good" results on read cluster data #40

Closed HinLeung622 closed 4 years ago

HinLeung622 commented 4 years ago

@grd349 And after a few months of hard work a lot of problems that we had to solve (or give up on), today I can finally present some of the first "report level" results:

First of all, after my previous issue post, Harry pointed out a very big detail that I overlooked when we selected our data for our clusters: I was treating the cluster data like our training data, and included some low RGB stars in the cluster data. Given that we already know our RGB will be doing badly, why even bother to leave in those RGB stars at the first place? So with this, we removed some more RGB stars, from this: image to this: image

I put on an (basically) identical HBM run as last time for M67, but for way more tuning steps, and here is the results: image pretty good Rhats for most of the hyperpriors, feh seems to be the most problematic. image image Great agreement between the chains on everything outside feh. Mean helium is off to one side, this is due to the prior being Beta(1.1,1.1)*0.3+0.26, which the estimated mean helium of M67 seems to be closer to 0.26 than I first expected (as I went off the assumption that M67 is basically solar initial conditions). But even with helium and feh being slightly problematic, the correlations reported in McKeever's paper on NGC6791, and other known correlations in clusters is clearly visible: the anti-correlation between mean_Y and mean_age, between mean_feh and mean_age, and the positive correlation between mean_Y and mean_feh. Interestingly, there is a negative correlation between mean_Y and mean_MLT, don't know why this is the case.

For sampling regions: image Pretty good.

I also figured out how to plot the isochrone along with a 1sigma spread around it under the cluster's data: image Dark grey is where stars would lie if they were within 1x spread value in age, feh and/or helium away from the mean cluster values. Light grey is 2x spread. I cut off the shaded regions plots at early RGB due to the shaded regions are done by NN predictions, and the predictions fall apart at the RGB, creating very ugly and wrong shapes.

Note that this HBM result uses a version of M67 cluster data that still has its low RGB stars not-removed (as discussed above). I am currently running another HBM that has those stars removed and also with a wider and lower mean_Y hyperprior. I will report the results when I have them.

HinLeung622 commented 4 years ago

@grd349 But I have more results: NGC6791, a 8Gyr cluster that is metal rich (feh = 0.4) and helium rich (Y=0.3): Location on our training data: image It only has 31 stars, after we removed the lower RGB.

Results: image Super good Rhats, and that is with only 5000 tuning steps, 1/4 the amount needed for M67 above. image image Great agreement between chains, the only problem seems to be mixing length, that is all the way at the edge of our training data range (1.7-2.3). Corner plot displays all the same correlations mentioned above (but to a smaller extent). Sampling regions: image HBM is able to recover the correct stars in the correct locations on the HR.

But problem shows up when we plot the fitted isochrone: image That isochrone, skipping the dip in the subgaint, is just wrong, and this is a neural net problem. This links back to how the NN we are currently using, is not doing well in the feh dimension: image These plots shows how well the NN is able to generalize the behaviour of the data in between the tracks, in mass, feh, Y and MLT space. The plots look a little mess, due to I deliberately shifting the tracks in the direction that will speed up stellar evolution, causing the excess at the RGB that sometimes bend back. But anyhow, it is very clear that in the mass, Y and MLT dimensions, the NN is doing a much better job in generalizing in between tracks within the boundaries of training data, than in feh space. I have talked to Alex about this, and he suggested to try taking out batch normalization, as he has seen certain patterns in our feh varying plot before in his batch norm experiments. So I have trained up a NN that does not use any batch norm, and am now running a HBM with that NN. It seems to have shown slightly better generalizability in the feh space: image Again, I will report back when that HBM is finished.

On the other hand, seeing the HBM results for NGC6791, Harry suggested the possible solution of training cluster-specific NNs, as we speculated one of the reasons NGC6791's isochrone is looking less good compared to M67, is due to its metallicity and helium fraction being more distant from solar values than M67 is, which we know that NN does best at its central, solar initial conditions. So Harry is experimenting with training a NN only one NGC6791-relevant data, but is getting possibly better results on trying to improve the feh generalizability. image Ignoring the top feh track that is outside the training sample, the other in between feh tracks are well within the boundaries of the black, on track lines, which is a good sign.

Another problem we have spotted (I have knew this for a week now but it didn't impact our HBM so I not mention it), is overfitting in the obversable-age dimension: image This is a observable vs age plot of one random track. We are plotting 10 additional NN predict points between each grid data point. And the spread of blue dots caused by the "in between" dots is clearly a sign of overfitting. We have tried increasing regularization to combat this problem, but it seems the NN's ability to produce good predictions in all input dimensions, and the loss we are able to push it down to, is quite sensitive to regularization, so we are kind of stuck. Harry will be looking further into this before Monday.

HinLeung622 commented 4 years ago

@grd349 I just noticed that all the 2x2 in between plots either all have the same title, or do not have titles. All of their top left should be varying mass, top right is varying feh, bottom left varying Y and bottom right varying MLT.

HinLeung622 commented 4 years ago

@grd349 Just want to let you know that I got the VPN working, I can now access bluebear from home

grd349 commented 4 years ago

Excellent! Dr Guy R. Davies PI - ERC CartographY Project Senior Lecturer in Astrophysics School of Physics and Astronomy The University of Birmingham Edgbaston Birmingham B15 2TT

Tel +44 (0) 121 414 4597 G.R.Davies@bham.ac.uk grd349@gmail.com davies@bison.ph.bham.ac.u davies@bison.ph.bham.ac.ukk davies@bison.ph.bham.ac.uk

The contents of this e-mail may be privileged and are confidential. It may not be disclosed, used, or copied in any way by anyone other than the addressee. If received in error please notify the sender then delete it from your system. Should you communicate with the sender by e-mail, you consent to The University of Birmingham monitoring and reading any such correspondence.

On Mon, 16 Mar 2020 at 17:10, HinLeung622 notifications@github.com wrote:

@grd349 https://github.com/grd349 Just want to let you know that I got the VPN working, I can now access bluebear from home

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Harry-Westwood/Fourth-Year-Project/issues/40#issuecomment-599656453, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADQZOCNJO5NWMPJFPXZ6F5TRHZMPLANCNFSM4LJNORVQ .

HinLeung622 commented 4 years ago

@grd349 What is Tanda's email? The one I have does not seem to be working...

HinLeung622 commented 4 years ago

@grd349 What do you think might be the problem of this cluster in HBM? https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC2158_trial2.ipynb NGC2158, known to be an intermediate age : 2Gyr and metal poor:-0.3 Fe/H cluster. At first, it would seem like we got a good estimate on this cluster, but looking at the fitted isochrone plot at the bottom of the notebook, it is clear the HBM is incredibly confused. What do you think might be causing this problem? Could it be the lack of stars in low MS and high subgiant? Or the stars around the hook are confusing the HBM a lot? This is what happens when I plot the data along with an isochrone deduced using literature values of its age, Fe/H and assuming solar Y and MLT: image And all the stars are pretty off.

Also, we got great results for NGC752: https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC752_trial1.ipynb And okish result for NGC188: https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC188_trial3.ipynb We also got great results for NGC6791 yesterday: https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC6791_trial5.ipynb

These results will probably be the ones we use in our report.

grd349 commented 4 years ago

That looks like some good results to me!!!

You might want to update the plots to exclude the end of the red line isochrone.

For 188 - why are all the points lying to the lower temperature side of the lines?

Excellent work! :)

G Dr Guy R. Davies PI - ERC CartographY Project Senior Lecturer in Astrophysics School of Physics and Astronomy The University of Birmingham Edgbaston Birmingham B15 2TT

Tel +44 (0) 121 414 4597 G.R.Davies@bham.ac.uk grd349@gmail.com davies@bison.ph.bham.ac.u davies@bison.ph.bham.ac.ukk davies@bison.ph.bham.ac.uk

The contents of this e-mail may be privileged and are confidential. It may not be disclosed, used, or copied in any way by anyone other than the addressee. If received in error please notify the sender then delete it from your system. Should you communicate with the sender by e-mail, you consent to The University of Birmingham monitoring and reading any such correspondence.

On Wed, 18 Mar 2020 at 00:06, HinLeung622 notifications@github.com wrote:

@grd349 https://github.com/grd349 What do you think might be the problem of this cluster in HBM?

https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC2158_trial2.ipynb NGC2158, known to be an intermediate age : 2Gyr and metal poor:-0.3 Fe/H cluster. At first, it would seem like we got a good estimate on this cluster, but looking at the fitted isochrone plot at the bottom of the notebook, it is clear the HBM is incredibly confused. What do you think might be causing this problem? Could it be the lack of stars in low MS and high subgiant? Or the stars around the hook are confusing the HBM a lot? This is what happens when I plot the data along with an isochrone deduced using literature values of its age, Fe/H and assuming solar Y and MLT: [image: image] https://user-images.githubusercontent.com/56083013/76912270-2bb1f280-68ab-11ea-9576-748448f38349.png And all the stars are pretty off.

Also, we got great results for NGC752:

https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC752_trial1.ipynb And okish result for NGC188:

https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC188_trial3.ipynb We also got great results for NGC6791 yesterday:

https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC6791_trial5.ipynb

These results will probably be the ones we use in our report.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Harry-Westwood/Fourth-Year-Project/issues/40#issuecomment-600358901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADQZOCJJHI5LANSLSZALDYTRIAF77ANCNFSM4LJNORVQ .

HinLeung622 commented 4 years ago

@grd349 Yeah I probably should cut off the red line of the isochrones to the same extent as the shaded regions.

The problem with NGC188 is that it might be a NN issue, where at the age, feh and Y region around the best fit values for NGC188, the NN fails to produce any isochrone that fits the stars any better than what is seen there. It is possible that any other isochrones the HBM have "tried" only deviate further in increasing luminosities (or increasing Teff). This situation is observed more clearly in an early HBM trial of NGC6791: (trial 2) image This HBM is done with the same NN as the one in NGC188, and the deviate from subgiant of the isochrone is caused by overfitting of the NN in feh space, which we know is a persistent problem in our final NNs. This problem gets worse the more the cluster deviates from solar metallicities, and NGC6791 here is +0.4 Fe/H. NGC188 is estimated to have an feh of 0.08, which isn't much from solar values, but that might be causing the problem together with the lack of MS stars data. This is the reason why we had to train a NN on NGC6791-specific training data in hopes that there will be less overfitting in feh space, which gives the HBM result in NGC6791 trial 5: https://github.com/Harry-Westwood/Fourth-Year-Project/blob/master/HBM%20results/read_NGC6791_trial5.ipynb

Also, can you give some thoughts about NGC752 in the post above?

HinLeung622 commented 4 years ago

@grd349 The newest HBM result for NGC6819, the one we discussed yesterday about the hook and overshoot issues, and it looks pretty bad after I removed some high MS stars and put back in some potential hook stars: image image image What do you think about this? To me it seems like even at the MS, the stars' luminosities are just a little bit too low. If they were raised by say, 0.1 in log luminosity, the isochrone will get a much better fit in the MS. We already went back and checked our luminosity calculations for the cluster the day we altered the stars we put into this cluster, and there didn't seem to be any problems, so I am not sure how to improve on this and get the HBM to estimate properly.

grd349 commented 4 years ago

I think this is proof that you need extra physics in the models (although this one just hasn't converged). Write up what you have that works and don't chase perfection - this is astrophysics, everything is wrong. It's the degree of wrongness that is interesting :)

HinLeung622 commented 4 years ago

@grd349 Ok I guess I will just try putting on a lot more tuning steps and hope for the best.