Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 21 01:03
    bocklund closed #221
  • May 21 01:03

    bocklund on master

    ENH: Allow entering the `__HYPE… (compare)

  • May 21 01:03

    bocklund on master

    MAINT: Update for CompositionSe… (compare)

  • May 21 01:03
    bocklund closed #232
  • May 21 00:48
    bocklund opened #232
  • May 16 04:04
    bocklund synchronize #221
  • May 07 01:44

    bocklund on richardotis-patch-1

    (compare)

  • May 07 01:43

    bocklund on master

    DOC: Fix small typo on homepage… (compare)

  • May 07 01:43
    bocklund closed #231
  • May 07 01:43
    bocklund commented #231
  • May 07 00:25
    richardotis opened #231
  • May 07 00:24

    richardotis on richardotis-patch-1

    Fix small typo on homepage (compare)

  • May 03 16:42
    bocklund opened #230
  • Apr 28 18:33

    bocklund on master

    FIX: Fix generate_symmetric_gro… (compare)

  • Apr 28 18:33
    bocklund closed #229
  • Apr 27 18:57
    bocklund synchronize #229
  • Apr 27 17:35
    bocklund synchronize #229
  • Apr 27 07:40
    bocklund synchronize #229
  • Apr 27 07:38
    bocklund synchronize #229
  • Apr 27 07:26
    bocklund commented #229
Brandon Bocklund
@bocklund

For the direct parameter generation, it's unlikely that it will be supported because the ionic liquid requires doing the energy minimization step to determine the site ratios of the cation and anion sublattices which allow the liquid to charge balance.

On the other hand, because the ionic liquid model is supported by pycalphad, you can use ESPEI to try to optimize the parameter values via MCMC if you supply a parameterized model with reasonable starting values

juejing-liu
@juejing-liu
Oops I made a mistake. I am working on the ionic solid instead of the ionic liquid. Could ESPEI handle this model?
Brandon Bocklund
@bocklund

pycalphad doesn't support the ionic solid model yet (we had a closed PR that attempted to address it here: pycalphad/pycalphad#222). We have some solver changes upcoming that might make it worth addressing again.

I think that it would be possible to support parameter generation for ionic soilds, but that's not a high priority on our current roadmap for ESPEI and it would be pending support for ionic solids from pycalphad.

Pcascone
@Pcascone
I am trying to install espei via anaconda prompt as per the installation instructions on Windows 10 32bit but I get a version incompatibility error. "Output in format: requested package -> Available versions." pycalphad is the most recent build 0.8.4.
David Kleiven
@davidkleiven_gitlab

When I try to fit using MCMC I get some error. Here is how I started (datasets are stored in a folder called datasets):

  1. espei --check-datasets datasets: Finishes with no errors
  2. espei --input espei-in.yml: Finishes with no errors

where espei-in.yml looks like this:
system:
phase_models: mgsnX_input.json
datasets: datasets
generate_parameters:
excess_model: linear
ref_state: SGTE91
output:
output_db: mgsn.tdb

  1. espei --input mcmc.yml: This command causes errors

where mcmc.yml looks like this
system:
phase_models: mgsnX_input.json
datasets: datasets
mcmc:
iterations: 1000
input_db: mgsn.tdb
output:
output_db: mgsn_mcmc.tdb

I get the following error:

/home/davidkleiven/.local/lib/python3.7/site-packages/pycalphad/codegen/callables.py:97: UserWarning: State variables in build_callables are not {N, P, T}, but {T, P}. This can lead to incorrectly calculated values if the state variables used to call the generated functions do not match the state variables used to create them. State variables can be added with the additional_statevars argument.
"additional_statevars argument.".format(state_variables))
Traceback (most recent call last):
File "/home/davidkleiven/.local/bin/espei", line 11, in <module>
load_entry_point('espei', 'console_scripts', 'espei')()
File "/home/davidkleiven/Documents/ESPEI/espei/espei_script.py", line 311, in main
run_espei(input_settings)
File "/home/davidkleiven/Documents/ESPEI/espei/espei_script.py", line 260, in run_espei
approximate_equilibrium=approximate_equilibrium,
File "/home/davidkleiven/Documents/ESPEI/espei/optimizers/opt_base.py", line 36, in fit
node = self._fit(symbols, datasets, args, kwargs)
File "/home/davidkleiven/Documents/ESPEI/espei/optimizers/opt_mcmc.py", line 238, in _fit
self.predict(initial_guess,
ctx)
File "/home/davidkleiven/Documents/ESPEI/espei/optimizers/opt_mcmc.py", line 305, in predict
non_eq_thermochemical_prob = calculate_non_equilibrium_thermochemical_probability(parameters=np.array(params), *
non_equilibrium_thermochemical_kwargs)
File "/home/davidkleiven/Documents/ESPEI/espei/error_functions/non_equilibrium_thermochemical_error.py", line 271, in calculate_non_equilibrium_thermochemical_probability
points=data['calculate_dict']['points'])[output]
File "/home/davidkleiven/Documents/ESPEI/espei/shadowfunctions.py", line 55, in calculate
largest_energy=float(1e10), fake_points=fp)
File "/home/davidkleiven/.local/lib/python3.7/site-packages/pycalphad/core/calculate.py", line 190, in _compute_phase_values
param_symbols, parameter_array = extract_parameters(parameters)
File "/home/davidkleiven/.local/lib/python3.7/site-packages/pycalphad/core/utils.py", line 361, in extract_parameters
parameter_array_lengths = set(np.atleast_1d(val).size for val in parameters.values())
AttributeError: 'NoneType' object has no attribute 'values

has anyone seen this before or have can point me in the right direction? Thanks in advance for your help.

Brandon Bocklund
@bocklund
Hey @davidkleiven_gitlab, thanks for checking in here. This should be fixed by PhasesResearchLab/ESPEI#133 and a new release should be coming to conda-forge today
David Kleiven
@davidkleiven_gitlab
thanks, it worked now.
zhanghaihui
@zhanghaihui_gitlab
@bocklund Hi Brandon, would you mind explaining the definition and usage of data_weights for me in detail? The description in the manual is too short, I can’t understand how to use this key. Thanks.
Brandon Bocklund
@bocklund

@zhanghaihui_gitlab ESPEI computes the log-likelihood for every type of data by finding value of the log probability density function of a normal distribution centered at zero with a standard deviation of σ, i.e. norm(loc=0, scale=σ).logpdf(error) where error is the difference between the expected and calculated value for a particular set of parameters.

Since we have multiple types of data, a default value of the σ_initial exists for all supported data types to handle the different scales of error and to make the likelihoods comparable even though the errors are not. The data_weights modifies the σ used in the normal distribution by making σ = σ_initial/data_weight[data_type] for each data_type like ZPF or HM. By default, all data_weight values are 1.0, i.e. σ = σ_initial.

For example: consider that we have two experiments: one for enthalpy of formation data and one for entropy of formation data. If we calculate the error as the difference between the expected enthalpy of formation and the calculated enthalpy of formation, we might find the difference is 10 J/mol. If we do the same for the entropy of formation, we might find that the error is 5 J/K-mol.

Now we need to determine the likelihood for these two errors, one with a difference between the expected/calculated value of 10 and another of 5. Using our existing knowledge about the relative magnitudes of formation enthalpy vs. entropy, we know that an error of 10 J/mol in the enthalpy of formation is very close to the solution (i.e. high likelihood), while an error of 5 J/K-mol in the enthalpy of formation is probably not that close to the solution (i.e. low likelihood). The σ_initial are set so that the likelihoods of these two cases are comparable, but you might not agree with my choice of σ_initial or you might want to value a particular type of data more heavily than I do. data_weights lets you do that.

Let me know if this helps to clarify data_weights. I can update the docs with an edited version of this to help answer this question in the future
zhanghaihui
@zhanghaihui_gitlab
@bocklund Thank you very much for your answer, although I did not understand it before. Recently, I got it after learning some theoretical knowledge of statistics, but it was still very difficult before.
zhanghaihui
@zhanghaihui_gitlab
@bocklund Another question is how to determine the likelihood for difference errors and how to using existing knowledge about the relative magnitudes to judge it is available in detail?
zhanghaihui
@zhanghaihui_gitlab
I found it could judge some through log but I'm not sure. For example, when I change the data_weights of ZPF to 20, I found the likelihood of ZPF increase from -3000 to -800, and total likelihood also increase from -5000 to -1800. But the likelihood of Non-equilibrium thermochemical increase from -1300 to -800 although I did not change that parameter. I think the increase is too much. Is that normal? Is the reasonable likelihood higher than -2000?
bocklund
@bocklund:matrix.org
[m]
Test from Matrix
wahab2604
@wahab2604
image.png
Hi, I started adding activity data for my system for the MCMC , and realised it's lnprob doesn't move from iteration to iteration and it stays the same as the initial (i've changed how i've written the data i.e different references but its still the same), I can run the example and it works there. What could I be doing wrong ?
3 replies
hjy4090
@hjy4090
Is it possible by using ESPEI to produce ternary tdb file from the given binary tdb files or unary data out of the literature?
4 replies
Semen Kuzovchikov
@spike_k_gitlab
Hi there. Are there any arguments for using emcee? As I can see from examples most of the parameters in all of the chains remain stuck for 10 to 20 iterations despite being continually distributed.
5 replies
Semen Kuzovchikov
@spike_k_gitlab
Oh, that may be very useful for writing models for NUTS. Thanks for replying.
1 reply
Semen Kuzovchikov
@spike_k_gitlab
Okay, now i've got where it goes. The next step is implementing hierarchical bayesian models for higher than 3 components tdb databases.
Richard Otis
@rotis:matrix.org
[m]
@spike_k_gitlab: Like Brandon, I am also very interested in NUTS and other HMC-based approaches for thermodynamic optimization. In the JMR paper linked above, we showed that under mild (and common) assumptions, the likelihood gradient for thermodynamic parameter optimization is well-behaved. I have preliminary unpublished work suggesting that the use of likelihood gradients is likely to significantly accelerate convergence, especially for multi-component and multi-sublattice systems
I am not currently working the issue though. I'd be happy to hand over my materials and learnings to date to someone motivated to carry out the work to completion
Semen Kuzovchikov
@spike_k_gitlab
We are going with my student to try stan or pymc on espei as part of his master thesis. Paper mentioned above will sure save us a lot of work.
wahab2604
@wahab2604
Hi, I was looking for a way to quantify the results of the ESPEI fit against the experimental points i.e the deviation between the fit and the experimental points. I was thinking of using the pycalphad equilibrium function to calculate this. Is there a better way to do this ?
Brandon Bocklund
@bocklund:matrix.org
[m]
For what kind of data?
wahab2604
@wahab2604
ZPF data
Brandon Bocklund
@bocklund:matrix.org
[m]
If you want to be quantitative, probably the best place to start is by looking at driving forces. If you're willing to use my bocklund/zpf-misicbility-gap branch that's open in ESPEI#151, Tobias Spitaler and I just recently put together a new script that uses some refactoring to get at these driving forces a little easier. Here's the code example with some images: https://github.com/PhasesResearchLab/ESPEI/pull/151/#issuecomment-817177546
Of course, you don't have to plot the data on the diagram and you can compute whatever metrics you like once you have the driving forces
Brandon Bocklund
@bocklund:matrix.org
[m]
If you just want to get a feel for which data may be behaving poorly, the logs with output.verbosity: 3 can be insightful too, but there's a significant amount of output
wahab2604
@wahab2604
Thanks, having a look at it now, I like the plots of the driving force and yeh I was previously using the verbosity 3 and it got a bit overwhelming with the amount of data to look at
Semen Kuzovchikov
@spike_k_gitlab
Hi there. Could anyone please explain what does AssertionError: at least one set of points is within the target tolerance mean?
Semen Kuzovchikov
@spike_k_gitlab
Nevermind, figured that out. Tolerance is quite low I think (maybe it is better to make in tunable in options?)
Semen Kuzovchikov
@spike_k_gitlab
or maybe if tolerance is chosen arbitrarily we should not force it into error
Brandon Bocklund
@bocklund:matrix.org
[m]
I’ve been thinking of changing it to be the closest point + some amount (not tunable), but I haven’t gotten to it yet.
Semen Kuzovchikov
@spike_k_gitlab
I still don't get what that really means. Increased it up to 0.05 for my case and now thinking whether it is too high now. Probably not.
Brandon Bocklund
@bocklund:matrix.org
[m]

The motivation is that computing the driving force for the phase composition to be stable requires constrained equilibria instead of the global minimum solution.

We want to strike a balance between choosing a starting point near the solution, but have enough candidates to capture the correct (constrained) minimum energy if there are internal degrees of freedom.

Semen Kuzovchikov
@spike_k_gitlab
so if assertion fails it could be just increased little by little until it passes, right?
I mean: if assertion fails it doesn't mean that smth is wrong with the data, right?
Brandon Bocklund
@bocklund:matrix.org
[m]
It’s looking at some discretely sampled points. The error is if there are no sampled points near the prescribed phase composition in the data. That could be either because the points are not sampled densely enough (so increasing the tolerance or point density can fix it) or because the prescribed phase composition can’t be represented by the sublattice model (so the data phase composition or model could be wrong)
tobiasspt
@tobiasspt
Dear all,
We are currently using ESPEI to optimize a system with metastable phases. We have ZPF data for the stable and metastable case. When I want to optimize the metastable phase, I have to exclude the stable phases which are not present in the metastable case. Do I have to provide a TDB file, where these excluded stable phases are not present? Or is it possible to tell ESPEI to exlude some phases during equilibrium calculations in the ZPF routine?
Would it be possible to optimize the stable and metastable phase diagram at the same time?
Thx, Tobias
2 replies
tobiasspt
@tobiasspt
Hi all,
grafik.png
I have a question regarding the memory (RAM) usage of ESPEI.
An ESPEI run with approximately 110 ZPF data-points requires a large amount of memory. I am not familiar with how the scheduler works. The workers from the scheduler seem to require more and more RAM as the simulation goes on. Once the 128 GB of the workstation are full, a warning is printed:
distributed.nanny - WARNING - Restarting worker
ESPEI does not crash in the process. It seems that the restarted worker gets rid of the used RAM and starts fresh (I have marked the restarted worker in red). Does this behaviour influence change the result of ESPEI? If not, why do the workers need more and more RAM with time, finally consuming all of the available RAM?
2 replies
Used program versions:
espei 0.8.5
pycalphad 0.9.2
wahab2604
@wahab2604
Hi, is there a way to plot a ternary diagram with the zpf data on top of it. I know dataplot is used for binary plots, can this be used for ternary plot
2 replies
wahab2604
@wahab2604
Hi, can you use the parameter selection functionality to only fit the excess terms in solid solutions. For example I have a TDB with the Gibbs energy for all stoichiometric compounds but want to use paramselect to know what L terms to use for the solid solutions (CEF model)
3 replies
jaYINGLING
@jaYINGLING
espei_mem_available.JPG
espei_mem_full.JPG
jaYINGLING
@jaYINGLING
Hello, I am noticing a progressive consumption of RAM on version 0.8.7. As you can see, eventually memory usage goes to the pagefile and performance drops considerably.
2 replies
BenedicteM
@BenedicteM
Hello, I am using plot_interaction to compare calculated data to experimental ones and I would like to extract the temperature from datasets. How can I do ? Thanks.
2 replies