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 strain1/2 ln C(by default; its stressTconjugate 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 (.npzwith JSON metadata).Learned laws (
behaviour):learnedin 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: thetimes(paths x points), thestrainand thestress(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, orS(E));seed, that of its initial parameters.LearnedBehaviour— A learned law of a material:model, the file of a model ofmorphogen.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 kindMFRONTamongkind, of the lawspmat), integrated by their models in the axes of their materials (rotations: the orientation of each rowpoint_matof the materials,crystal = g sample; the laws not oriented in the axes of the sample); the interface ofMFrontPoints.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 itsmetadata(the data, the training). In finite strains its optionstrain(STRAINS) chooses the strain it sees,1/2 ln CorE(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, orpsi(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 outputT, the default; orEand its increments, its outputS);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;ratealone gives viscoelasticity);smoothing, the scaledeltaof the normalized increments below which the rate-independent dissipation is smoothed;seed, that of its initial parameters. Its dissipation hasinternalsmoothed norms andinternalridges.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 ofmodelto those ofdata: relative to the root mean square of the stresses of each path (paths: one per path; theirmeanandmax) 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 ofsource(seeresponder(): a material at a material point, or a callablepath -> PathResultof a microstructure) alongpaths(loading paths or their specifications, all of the same numbers of steps), at their planned steps.callback(done, total)after each path (it may raiseStopped).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 (ormodel, trained further) and the summary of the data, of the training, of its errors and of the files written (relative tobase).callback: that oftrain().learned_law— The learned law ofspecfor 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— AMaterialof the learned law ofmodel(a model, its file, or aLearnedBehaviour), 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 byModel.save().make_model— A model ofkind(KINDS) with its options (hidden,seed,strainin finite strains;ratefor a recurrent or standard model;internal,plasticandsmoothingfor a standard model).path_errors— The gaps of the learned law ofmodelat a material point to the responses ofsource(responder()) along namedpaths(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—nrandom strain paths ofsegmentslinear segments ofincrementssteps.responder— The response to a path ofsource: a material (aMaterialor its configuration) at a material point (turned by the Bunge anglesorientationof a crystal), or a callablepath -> PathResult(a microstructure).train— Trainmodelondata(see the module), set up on them first when it has no parameters;validation: the paths of the early stopping. Withrotate(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 raiseStopped).