12 Matching Annotations
  1. Apr 2024
    1. pure function

      在编程中,"纯函数"(Pure Function)是指满足以下两个条件的函数:

      1. 对于相同的输入,总是返回相同的输出。
      2. 不产生任何副作用。

      "副作用"是指函数在计算结果之外对系统状态的任何更改,例如修改全局变量,修改输入参数,进行 I/O 操作等。

      BlocBuilder 的上下文中,builder 函数应该是一个纯函数,这意味着它应该只根据其输入(即 BLoC 的状态)来返回一个新的 widget,而不应该有任何副作用。这样可以确保每次状态改变时,UI 都能可预测地更新。

    1. buffer, debounceTime, throttle

      buffer, debounceTimethrottle 都是 RxJS 中的操作符,它们在 Flutter 的 BLoC(Business Logic Component)模式中也可以使用,因为 BLoC 模式使用了流(Stream)来处理数据。

      1. bufferbuffer 是一个操作符,它将源 Observable 的值收集到一个数组中,然后发出这个数组,而不是逐个发出值。当它接收到另一个 Observable 发出的信号时,它会发出当前的数组,并开始收集下一个。

      2. debounceTimedebounceTime 是一个操作符,它会在源 Observable 发出值后等待一段时间(由你设定),如果在这段时间内源 Observable 没有发出新的值,那么它就会发出最后一个值。如果在这段时间内源 Observable 发出了新的值,那么它就会忽略前一个值,重新开始等待。

      3. throttlethrottle 是一个操作符,它会在源 Observable 发出值后立即发出这个值,然后在一段时间内忽略源 Observable 的其他值。这段时间可以是固定的,也可以由另一个 Observable 的发出值来决定。

      这些操作符在处理复杂的异步操作时非常有用,例如在用户输入时进行自动完成或限制 API 请求的频率等。

    2. The above Transition gives us all the information we need to understand why the state changed. If we had used a Cubit to manage the AuthenticationState, our logs would look like:

      Bloc相对于Cubit的优点在于可以跟踪状态的改变是由那些事件引起的

    3. One of the biggest advantages of using Cubit is simplicity. When creating a Cubit, we only have to define the state as well as the functions which we want to expose to change the state. In comparison, when creating a Bloc, we have to define the states, events, and the EventHandler implementation. This makes Cubit easier to understand and there is less code involved.

      Cubit和Bloc的区别:

      Cubit只需要定义state和能改变state的function

      Bloc要定义state,event和event handler

    4. Blocs should never directly emit new states. Instead every state change must be output in response to an incoming event within an EventHandler.

      不应当直接使用emit更新状态,(应当在EventHandler中使用)

  2. May 2023
    1. The name of the property containing the class value. Each feature must have this property, and its value must be numeric.

      包含类值的属性的名称。每个要素都必须具有此属性,并且其值必须是数字。

    2. The list of property names to include as training data. Each feature must have all these properties, and their values must be numeric. This argument is optional if the input collection contains a 'band_order' property, (as produced by Image.sample).

      要作为训练数据包含的属性名称列表。每个要素都必须具有所有这些属性,并且其值必须是数值。如果输入集合包含“band_order”属性(由 Image.sample 生成),则此参数是可选的。

    3. Support Vector Machine

      什么是向量机?

      支持向量机(Support Vector Machine,SVM)是一种二分类模型,它的基本思想是在特征空间上构造最优超平面,将数据进行分类。在训练过程中,SVM会找到一个最优决策边界(即最优超平面),使得该边界具有最大的间隔(即“街道”),同时能够正确地将不同类别的样本分开。

      SVM 的训练过程可以转化为求解一个二次规划问题,通过对样本间距离(即点到超平面距离)的最小化以及对分类误差的控制来得到最优的超平面。当数据线性可分时,SVM 可以直接应用线性核函数来构造最优超平面;当数据线性不可分时,可以使用非线性核函数将原数据映射到高维空间,以便于构造更好的超平面。

      SVM 除了可以进行二分类,还可以通过一些变形和技巧实现多分类、回归、异常检测等任务。SVM 具有良好的泛化能力和鲁棒性,在许多实际问题中得到了广泛的应用。

    4. decisionProcedure, svmType, kernelType, shrinking, degree, gamma, coef0, cost, nu, terminationEpsilon, lossEpsilon, oneClass
      1. decisionProcedure:一个字符串,指示 SVM 使用的决策函数。它可以是 "ovo" 表示一对一或 "ovr" 表示一对多。
      2. svmType:一个字符串,指定 SVM 的类型。可以是 "c_svc" 用于 C-SVM 分类,"nu_svc" 用于 nu-SVM 分类,"one_class" 用于新颖性检测,或 "epsilon_svr" 用于 epsilon 支持向量回归。
      3. kernelType:一个字符串,指定核函数类型。可以是 "linear"、"poly"、"rbf"、"sigmoid" 或 "precomputed"。
      4. shrinking:一个布尔值,指示是否在训练过程中使用压缩启发式算法。如果设置为 true,则可以加快培训过程并减少内存使用。
      5. degree:一个整数,指定多项式核的次数。仅当kernelType 设置为 "poly" 时使用。
      6. gamma:一个数字,指定 RBF、poly 和 sigmoid 核的 gamma 参数。它控制核函数的形状,并影响决策边界的平滑度。
      7. coef0:一个数字,指定多项式和 sigmoid 核的系数。仅当 8. kernelType 设置为 "poly" 或 "sigmoid" 时使用。
      8. cost:一个数字,指定 C-SVM 和 nu-SVM 分类的成本参数。它权衡了边界大小和分类误差。
      9. nu:一个数字,指定 nu-SVM 分类的 nu 参数。它是训练误差比例上限和支持向量比例下限。
      10. terminationEpsilon:一个数字,指定停止准则的容差值。
      11. lossEpsilon:一个数字,指定损失估计的容差值。仅当 13. svmType 设置为 "epsilon_svr" 时使用。
      12. oneClass:一个布尔值,表示 SVM 是否用于单类分类。
    5. The number of values to accumulate before building the initial histogram.

      maxRaw 参数用于构建直方图。它指定在构建初始直方图之前可以累积的最大值数量。一旦值的数量超过了 maxRaw,就会构建直方图,并将后续的值添加到现有的直方图中。如果未指定 maxRaw,则实现可能会根据可用内存和其他因素选择合理的默认值。

    1. The Terra and Aqua combined Moderate Resolution Imaging Spectroradiometer (MODIS) Land Cover Type (MCD12Q1) Version 6.1 data product provides global land cover types at yearly intervals. The MCD12Q1 Version 6.1 data product is derived using supervised classifications of MODIS Terra and Aqua reflectance data. Land cover types are derived from the International Geosphere-Biosphere Programme (IGBP), University of Maryland (UMD), Leaf Area Index (LAI), BIOME-Biogeochemical Cycles (BGC), and Plant Functional Types (PFT) classification schemes. The supervised classifications then underwent additional post-processing that incorporate prior knowledge and ancillary information to further refine specific classes. Additional land cover property assessment layers are provided by the Food and Agriculture Organization (FAO) Land Cover Classification System (LCCS) for land cover, land use, and surface hydrology. Layers for Land Cover Type 1-5, Land Cover Property 1-3, Land Cover Property Assessment 1-3, Land Cover Quality Control (QC), and a Land Water Mask are also provided.

      Terra和Aqua结合的Moderate Resolution Imaging Spectroradiometer(MODIS)Land Cover Type(MCD12Q1)Version 6.1数据产品提供全球每年一次的土地覆盖类型。 MCD12Q1 Version 6.1数据产品是使用MODIS Terra和Aqua反射率数据进行监督分类得出的。土地覆盖类型来自于国际地球系统科学协会(IGBP)、马里兰大学(UMD)、叶面积指数(LAI)、生物地球化学循环(BGC)和植物功能类型(PFT)分类方案。然后,监督分类经过其他后处理,通过使用先前知识和辅助信息来进一步细化特定类别。食品和农业组织(FAO)土地覆盖分类系统(LCCS)还提供了土地覆盖、土地利用和表面水文的附加土地覆盖属性评估层。

      提供土地覆盖类型1-5、土地覆盖属性1-3、土地覆盖属性评估1-3、土地覆盖质量控制(QC)以及土地水体掩模层。

    1. QA_PIXEL

      Landsat 8的QA_PIXEL波段是一种特殊的波段,用于描述每个像素的质量。在这个波段中,每个像元的值都是一个32位的整数,包含了该像元的几何校正、大气校正和云、水、雪等遮挡信息的质量指示码(Quality Assessment)。这个指示码的二进制表示方式是从右往左的,分别代表像素质量的不同方面。

      通过检查QA_PIXEL波段可以有效地识别出卫星图像中存在的各种问题,帮助用户更好地使用遥感数据进行科研或应用。