diff --git a/MindChemistry/version.txt b/MindChemistry/version.txt index 74a1f8ab2e15452392df5be4c43c1e95779534e0..341cf11faf9a29504168de4e54beaad182c5adc5 100644 --- a/MindChemistry/version.txt +++ b/MindChemistry/version.txt @@ -1,2 +1 @@ -0.2.0 -0.1.0 \ No newline at end of file +0.2.0 \ No newline at end of file diff --git a/MindFlow/mindflow/cell/diffusion.py b/MindFlow/mindflow/cell/diffusion.py index 7444a9104a8932701a87b34df62d7572b09c9da9..a407ca81f150df8d90b3cf1f3253b12f8bde16a1 100644 --- a/MindFlow/mindflow/cell/diffusion.py +++ b/MindFlow/mindflow/cell/diffusion.py @@ -391,7 +391,7 @@ class DDPMScheduler(DiffusionScheduler): beta_schedule (str): The beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from `linear`, `scaled_linear`, or `squaredcos_cap_v2`. Default: ``squaredcos_cap_v2``. prediction_type (str): Prediction type of the scheduler function; can be `epsilon` (predicts the noise of the diffusion process), - `sample` (directly predicts the noisy sample`) or `v_prediction` (see section 2.4 of `Imagen + `sample` (directly predicts the noisy sample) or `v_prediction` (see section 2.4 of `Imagen Video `_ paper). Default: ``epsilon``. variance_type (str): Clip the variance when adding noise to the denoised sample. Choose from ``fixed_small``, ``fixed_small_log``, ``fixed_large``, ``fixed_large_log``, ``learned`` or ``learned_range``. Default: ``fixed_small_log``. diff --git a/MindSPONGE/applications/model_cards/DNABERT.MD b/MindSPONGE/applications/model_cards/DNABERT.MD index 2fe9e945f54c5b4fee38656ba8ba4cb1f10c044b..fafd0b2293d0144fb1a77a3e3127d79ab8245536 100644 --- a/MindSPONGE/applications/model_cards/DNABERT.MD +++ b/MindSPONGE/applications/model_cards/DNABERT.MD @@ -31,12 +31,17 @@ DNABERT 模型通过结合上下文捕获 DNA 序列的整体语义,表现出 1. 下载预训练数据和 `vocab.txt` 文件,确保环境配置完成 2. 运行 `pretrain.py` 开始预训练 3. 预训练模型权重默认保存在 `checkpoints` 文件夹下 +4. 安装mindspore2.3.0rc4 mindnlp0.3.1 ### 微调 1. 下载微调数据和预训练模型权重 2. 运行 `finetune.py` 开始微调 3. 微调后的模型同样默认保存在 `checkpoints` 文件夹下 4. Training results for the first epoch: Validation Results: Accuracy: 97.8%, Avg loss: 0.076891 + +### 测试结果 +1. Validation Results: Accuracy: 97.1%, Avg loss: 0.096773 + ## 引用 diff --git a/docs/api_python/mindearth/module/mindearth.module.Trainer.rst b/docs/api_python/mindearth/module/mindearth.module.Trainer.rst index 6377c20d72bcde68abeb2000ab2f0c496377cbd9..3a7e8b56c120f8c95c860fa155998f213feef8a4 100644 --- a/docs/api_python/mindearth/module/mindearth.module.Trainer.rst +++ b/docs/api_python/mindearth/module/mindearth.module.Trainer.rst @@ -21,6 +21,17 @@ mindearth.module.Trainer - **TypeError** - 如果 `model` 或 `loss_fn` 不是mindspore.nn.Cell。 - **NotImplementedError** - 如果 `get_callback` 的方法没有实现。 + .. py:method:: mindearth.module.Trainer.get_callback() + + 用于定义模型的回调类。用户必须自定义重写该方法。 + + .. py:method:: mindearth.module.Trainer.get_checkpoint() + + 获得模型的checkpoint实例。 + + 返回: + Callback,模型的checkpoint实例. + .. py:method:: mindearth.module.Trainer.get_data_generator() 生成用于训练和验证数据集的数据生成器。 @@ -49,17 +60,6 @@ mindearth.module.Trainer 返回: Optimizer,模型的优化器。 - .. py:method:: mindearth.module.Trainer.get_checkpoint() - - 获得模型的checkpoint实例。 - - 返回: - Callback,模型的checkpoint实例. - - .. py:method:: mindearth.module.Trainer.get_callback() - - 用于定义模型的回调类。用户必须自定义重写该方法。 - .. py:method:: mindearth.module.Trainer.get_solver() 获得模型训练的求解器。 diff --git a/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst b/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst index 0876c03e8ec98a28b6de7514f7dba77ac701a4d6..984ffdc76ab4b1b242bbe134da28bfb56736c978 100644 --- a/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst +++ b/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst @@ -16,22 +16,6 @@ mindearth.module.WeatherForecast .. note:: 需要重写其中的成员函数 `forecast` 用于定义模型推理的前向过程。 - .. py:method:: mindearth.module.WeatherForecast.forecast(inputs, labels=None) - - 模型的预测方法。 - - 参数: - - **inputs** (Tensor) - 模型的输入数据。 - - **labels** (Tensor) - 样本真实数据。默认值: ``None``。 - - .. py:method:: mindearth.module.WeatherForecast.eval(dataset, generator_flag=False) - - 根据验证集数据或测试集数据执行模型推理。 - - 参数: - - **dataset** (mindspore.dataset) - 模型推理数据集,包括输入值和样本值。 - - **generator_flag** (bool) - 用于向 "compute_total_rmse_acc" 方法传递一个参数。指示是否使用数据生成器。默认值: ``False``。 - .. py:method:: mindearth.module.WeatherForecast.compute_total_rmse_acc(dataset, generator_flag) 计算数据集的总体均方根误差(RMSE)和准确率。 @@ -48,3 +32,21 @@ mindearth.module.WeatherForecast 异常: - **NotImplementedError** - 如果指定了不支持的数据源。 + + .. py:method:: mindearth.module.WeatherForecast.eval(dataset, generator_flag=False) + + 根据验证集数据或测试集数据执行模型推理。 + + 参数: + - **dataset** (mindspore.dataset) - 模型推理数据集,包括输入值和样本值。 + - **generator_flag** (bool) - 用于向 "compute_total_rmse_acc" 方法传递一个参数。指示是否使用数据生成器。默认值: ``False``。 + + .. py:method:: mindearth.module.WeatherForecast.forecast(inputs, labels=None) + :staticmethod: + + 模型的预测方法。 + + 参数: + - **inputs** (Tensor) - 模型的输入数据。 + - **labels** (Tensor) - 样本真实数据。默认值: ``None``。 + diff --git a/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst b/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst index de0b668a26983e7d3e8f44f3c81efa62ae0539fb..a7960e9eae2c3f7ec1cec5793cc4d2942aa4df2d 100644 --- a/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst +++ b/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst @@ -20,7 +20,7 @@ mindflow.cell.DDIMScheduler - **rescale_betas_zero_snr** (bool) - 是否重新缩放 betas 以使其终端 SNR 为零。这使模型能够生成非常明亮和黑暗的样本,而不是将其限制为中等亮度的样本。与 `offset_noise `_ 松散相关。默认值: ``False`` 。 - **compute_dtype** (mindspore.dtype) - 数据类型。默认值: ``mstype.float32`` ,表示 ``mindspore.float32`` 。 - .. py:method:: add_noise(original_samples, noise, timesteps) + .. py:method:: add_noise(original_samples: Tensor, noise: Tensor, timesteps: Tensor) DDIM前向加噪步骤。 diff --git a/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst b/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst index f07a19b1433ad84557ec7ee5f0a5a895f98467eb..62c9ac8314d6b009148df7360f717e8d8914d92c 100644 --- a/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst +++ b/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst @@ -12,7 +12,7 @@ mindflow.cell.DiffusionTransformer - **layers** (int) - `Transformer` 层数。 - **heads** (int) - 注意力头数。 - **time_token_cond** (bool) - 是否将时间作为作为条件token。 Default: ``True`` 。 - - **compute_dtype** (mindspore.dtype) 计算数据类型。支持 ``mstype.float32`` or ``mstype.float16`` 。 默认值: ``mstype.float32`` ,表示 ``mindspore.float32`` 。 + - **compute_dtype** (mindspore.dtype) - 计算数据类型。支持 ``mstype.float32`` or ``mstype.float16`` 。 默认值: ``mstype.float32`` ,表示 ``mindspore.float32`` 。 输入: - **x** (Tensor) - 网络输入。shape为 :math:`(batch\_size, sequence\_len, in\_channels)` 的Tensor。 diff --git a/docs/api_python/mindflow/core/mindflow.core.AdaHessian.rst b/docs/api_python/mindflow/core/mindflow.core.AdaHessian.rst index 6b75f82c073431e5c8c3a856e702c8e0c5ba71cc..ee3a3c9e438151b36bc16a9a859c74c243c9d4f6 100644 --- a/docs/api_python/mindflow/core/mindflow.core.AdaHessian.rst +++ b/docs/api_python/mindflow/core/mindflow.core.AdaHessian.rst @@ -1,7 +1,7 @@ mindflow.core.AdaHessian ========================= -.. py:class:: mindflow.core.AdaHessian(*args, **kwargs) +.. py:class:: mindflow.core.AdaHessian(params, learning_rate=1e-3, beta1=0.9, beta2=0.999, eps=1e-8, use_locking=False, use_nesterov=False, weight_decay=0.0, loss_scale=1.0, use_amsgrad=False, **kwargs) 二阶优化器 AdaHessian,利用 Hessian 矩阵对角元信息进行二阶优化求解。 有关更多详细信息,请参考论文 `ADAHESSIAN: An Adaptive Second Order Optimizer for Machine Learning `_ 。