@Testpublicvoidtest2(){List<Integer> numberList =getNumberList(10,()->(int)(Math.random()*100));for(Integer num : numberList){System.out.println(num);}}//需求:产生一些整数,并放在集合中publicList<Integer>getNumberList(int num,Supplier<Integer> sup){List<Integer> list =newArrayList<>();for(int i =0; i < num ; i++){
list.add(sup.get());}return list;}
3、函数型接口
@Testpublicvoidtest3(){String result =Strandler("\t\thello world,i like china!", str -> str.trim());System.out.println(result);}//需求:用于处理字符串publicStringStrandler(String str,Function<String,String> fun){return fun.apply(str);}
4、断言形接口
@Testpublicvoidtest4(){List<String> employees =Arrays.asList("hello","houchen","shuchenxi");List<String> list =filterStr(employees, str -> str.length()>3);for(String s : list){System.out.println(s);}}//需求:将满足条件的字符串放入集合中publicList<String>filterStr(List<String> list,Predicate<String> pre){List<String> stringList =newArrayList<>();for(String str : list){if(pre.test(str)){
stringList.add(str);}}return stringList;}
大语言模型的训练过程一般包括3个阶段:预训练(Pre-training)、SFT(有监督的微调,Supervised-Finetuning)以及RLHF(基于人类反馈的强化学习,Reinforcement Learning from Human Feedb…
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class FollowPathMove : MonoBehaviour
{public Transform[] wayPointArray;[SerializeField] private Transform PathA;//路径点的父物体[SerializeField]private Trans…
华为海思校园招聘-芯片-数字 IC 方向 题目分享(共9套,有答案和解析,答案非官方,未仔细校正,仅供参考)——第二套(共九套,每套四十个选择题)
部分题目分享,完整版获取&am…