morphogen.learning

Behaviours learned from data: networks trained on the responses of morphoGen’s behaviours (or of a microstructure) along random loading paths, then integrated in place of a behaviour.

  • Data (data): random strain paths, the responses of a material point (simulate_point()) or of the path solvers of a microstructure along them, splits and normalization.

  • Models (networks), their gradients written out: a perceptron of the stress (FeedForward), the stress derived from a learned convex potential (Potential: hyperelastic, a symmetric positive tangent) and a recurrent network over the strain increments with learned internal variables (Recurrent: path-dependent responses, plasticity) and a learned generalized standard material (Standard, standard: a convex free energy and a convex dissipation potential of learned internal variables, the state of a step the minimizer of the incremental potential: a nonnegative dissipation and a symmetric tangent by construction). In finite strains every model is of the logarithmic strain 1/2 ln C (by default; its stress T conjugate to it, S = J^T T, logarithmic) or of the Green-Lagrange strain, objective.

  • Training (training): Adam on mini-batches, early stopping on a validation set, the paths turned by the symmetries of the behaviour (uniform rotations, those of the cube), seeded; the files of the models (.npz with JSON metadata).

  • Learned laws (behaviour): learned in the configuration of a material integrates its points by a model, at a material point, by finite elements and on voxels, in the axes of its material (turned by the orientation of each grain, as crystals), the stress-free thermal strain of its expansion taken out.

  • learn(): data, training, evaluation and file of a configuration (morphogen learn).

  • MFront sources (mfront): a learned law as an MFront behaviour (its trained parameters as constants, morphoGen’s C++ port of the model, learned.cpp), for AMITEX_FFTP, Cast3M, Abaqus and Code_Aster (morphogen.io.mfront.mfront_source(), morphogen mfront, the AMITEX and Abaqus exports).

Public names

  • Dataset — Responses along paths: the times (paths x points), the strain and the stress (paths x points x 6, Voigt; engineering shears), the first point of each path the natural state, in small strains or (measure="green-lagrange") the Green-Lagrange strain and the second Piola-Kirchhoff stress; info: how they were made (the behaviour, the paths).

  • FeedForward — The stress of the strain by a perceptron (see the module): hidden, the sizes of its hidden layers; strain, the strain it sees in finite strains (STRAINS; T(1/2 ln C), the default, or S(E)); seed, that of its initial parameters.

  • LearnedBehaviour — A learned law of a material: model, the file of a model of morphogen.learning (.npz, save()) or the model itself; oriented: the law in the axes of its material, turned by the orientation of its point (that of its grain in a polycrystal) as a crystal is, or (false) in the axes of the sample everywhere.

  • LearnedLaw — A learned law loaded for the points of a material: its model and kinematics, and the thermal expansion of its material (3 x 3, per unit change of temperature, in the axes of the material; None without one).

  • LearnedPoints — The integration points of the materials with a learned law (those of kind MFRONT among kind, of the laws pmat), integrated by their models in the axes of their materials (rotations: the orientation of each row point_mat of the materials, crystal = g sample; the laws not oriented in the axes of the sample); the interface of MFrontPoints.

  • Model — A learned behaviour: its parameters (params, arrays), the normalization of its training set (scales), the measure of its data ("small" or "green-lagrange"), its options and its metadata (the data, the training). In finite strains its option strain (STRAINS) chooses the strain it sees, 1/2 ln C or E (see the module).

  • Potential — The stress derived from a learned convex potential (see the module): hidden, the sizes of the hidden layers of its input-convex network; strain, the strain of the potential in finite strains (STRAINS; psi(1/2 ln C), the default, which represents Hencky’s elasticity with its quadratic term, or psi(E)); seed, that of its initial parameters.

  • Recurrent — A recurrent network over the steps of the paths (see the module): hidden, the size of its state; rate, whether the time step is an input (rate-dependent behaviours); strain, the strain it sees in finite strains (STRAINS: the logarithmic strain and its increments, its output T, the default; or E and its increments, its output S); seed, that of its initial parameters.

  • Scales — The normalization of the data: the root mean squares of the strain, of the stress, of the strain increments and the mean time step of a training set. The networks see the strains and the increments divided by theirs and give stresses divided by theirs: scalars, which keep the isotropy of the data and the potential of the stresses (Potential).

  • Standard — A learned generalized standard material (see the module): internal, the number of internal variables; hidden, the softplus ridges of its free energy; rate, a viscous dissipation (the time step matters); plastic, a rate-independent one (by default; rate alone gives viscoelasticity); smoothing, the scale delta of the normalized increments below which the rate-independent dissipation is smoothed; seed, that of its initial parameters. Its dissipation has internal smoothed norms and internal ridges. strain: that of its free energy in finite strains (STRAINS), the logarithmic strain (the default) or the Green-Lagrange strain; in small strains the free energy is of the small strain, which both linearize to.

  • Training — A training: the model (its parameters those of the best epoch), the losses of the training and validation sets at each epoch (mean squares of the gaps of the normalized stresses), the best epoch, whether it stopped early, its time.

  • errors — The gaps of the stresses of model to those of data: relative to the root mean square of the stresses of each path (paths: one per path; their mean and max) and of all (relative), and the root mean square of the gaps (rmse, in the units of the stresses). A recurrent model runs each path from its natural state.

  • generate — The responses of source (see responder(): a material at a material point, or a callable path -> PathResult of a microstructure) along paths (loading paths or their specifications, all of the same numbers of steps), at their planned steps. callback(done, total) after each path (it may raise Stopped).

  • isotropic_constants — Young’s modulus and Poisson’s ratio of the isotropic projection (Voigt’s means of the bulk and shear moduli) of a 6 x 6 stiffness (engineering shears).

  • learn — Learn the behaviour of a configuration (see the module): the trained model (or model, trained further) and the summary of the data, of the training, of its errors and of the files written (relative to base). callback: that of train().

  • learned_law — The learned law of spec for the points of a solver, its model checked against the kinematics (small strains, or the Green-Lagrange measures in finite strains); expansion: the thermal expansion tensor of its material (in its axes).

  • learned_material — A Material of the learned law of model (a model, its file, or a LearnedBehaviour), its elastic constants (the linear problems and the reference media) those given or of the isotropic projection of its initial tangent; expansion: its thermal expansion (one coefficient, principal values or a tensor in the axes of the material), the stress-free thermal strain taken out of the strain the model sees.

  • load_model — A model saved by Model.save().

  • make_model — A model of kind (KINDS) with its options (hidden, seed, strain in finite strains; rate for a recurrent or standard model; internal, plastic and smoothing for a standard model).

  • path_errors — The gaps of the learned law of model at a material point to the responses of source (responder()) along named paths (name -> path, its specification or its text): the root mean square of the gaps of the stresses (of the strains) relative to that of the stresses (of the strains) of the reference at the planned steps, and the final stresses of both; infinite gaps and the message where the learned law fails (no solution for the stresses prescribed, after four divisions of a step). The learned material takes the elastic constants of a reference material (else those of its initial tangent); orientation (Bunge angles) turns both, a crystal and its law learned in its axes.

  • random_paths — n random strain paths of segments linear segments of increments steps.

  • responder — The response to a path of source: a material (a Material or its configuration) at a material point (turned by the Bunge angles orientation of a crystal), or a callable path -> PathResult (a microstructure).

  • train — Train model on data (see the module), set up on them first when it has no parameters; validation: the paths of the early stopping. With rotate (true or "isotropic": an isotropic behaviour), each mini-batch of paths is turned by random rotations at each epoch (rotated()): the data of every direction, without more responses; with "cubic" (a cubic crystal, its data in its axes), by random rotations of the cube (cubic_rotations()). callback(epoch, train_loss, validation_loss) after each epoch (it may raise Stopped).

Modules