自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 python外部传参方法

sys.argv[]使用sys.argv[]说白了就是一个从程序外部获取参数的桥梁,这个“外部”很关键。因为我们从外部取得的参数可以是多个,所以获得的是一个列表(list),也就是说sys.argv其实可以看作是一个列表,所以才能用[]提取其中的元素。其第一个元素sys.argv[0]是程序本身,随后才依次是外部给予的参数。...

2021-08-05 13:31:47 3822 2

原创 机器学习—贝叶斯算法与朴素贝叶斯分类

asdf

2021-05-16 21:50:42 199

原创 Bert简介以及Huggingface-transformers使用总结

目录一、 Bert模型简介 1. bert预训练过程 2. bert输入二、Huggingface-transformers笔记 1. 安装配置 2. 如何使用  项目组件参考文章一、 Bert模型简介  2018年Bert模型被谷歌提出,它在NLP的11项任务中取得了state of the art 的结果。Bert模型是由很多层Transformer结构堆叠而成,和Attention模型一样,Transformer模型中也采用了 encoer-decoder 架构。但其结构相比于Attention

2021-02-20 18:49:32 4057

原创 Leetcode | Non-overlapping Intervals (无重叠区间)

Description:Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Example:Input: [[1,2],[2,3],[3,4],[1,3]]Output: 1Explanation: [1,3] can be removed and the rest o

2021-02-08 15:38:27 180

原创 Leetcode | Sort Colors (分发饼干)

Description:假设你是一位很棒的家长,想要给你的孩子们一些小饼干。但是,每个孩子最多只能给一块饼干。对每个孩子 i,都有一个胃口值 g[i],这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 j,都有一个尺寸 s[j] 。如果 s[j] >= g[i],我们可以将这个饼干 j 分配给孩子 i ,这个孩子会得到满足。你的目标是尽可能满足越多数量的孩子,并输出这个最大数值。Example:Input: g = [1,2,3], s = [1,1]Output: 1解释:你

2021-02-07 13:03:51 79

原创 Leetcode | Sort Colors (颜色分类)

Description:Given a string, sort it in decreasing order based on the frequency of characters.Example:Input: “tree”Output: “eert”Explanation:‘e’ appears twice while ‘r’ and ‘t’ both appear once.So ‘e’ must appear before both ‘r’ and ‘t’. Therefore

2021-02-07 11:09:35 96

原创 Leetcode | Sort Characters By Frequency (按照字符出现次数对字符串排序)

Description:Given a string, sort it in decreasing order based on the frequency of characters.Example:Input: “tree”Output: “eert”Explanation:‘e’ appears twice while ‘r’ and ‘t’ both appear once.So ‘e’ must appear before both ‘r’ and ‘t’. Therefore

2021-02-06 18:52:33 192

原创 Leetcode | Top K Frequent Elements (前 K 个高频元素)

Description:Given a non-empty array of integers, return the k most frequent elements.Example:Input: [3,2,1,5,6,4] and k = 2Output: 5Input: [3,2,3,1,2,4,5,5,6] and k = 4Output: 4Ideas: Python has lots of library functions, like sort().Sort the

2021-02-06 17:19:31 207

原创 Leetcode | Kth Largest Element in an Array (数组中的第K个最大元素)

Description:Given head, the head of a linked list, determine if the linked list has a cycle in it.There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos

2021-02-02 21:19:13 89

原创 Leetcode | Linked List Cycle (判断链表是否存在环)

Description:Given head, the head of a linked list, determine if the linked list has a cycle in it.There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos

2021-01-31 11:57:40 136 1

原创 Leetcode | Merge Sorted Array (合并两个有序数组)

Description:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.The number of elements initialized in nums1 and nums2 are m and n respectively. You may assume that nums1 has a size equal to m + n such that it ha

2021-01-31 11:57:30 115

原创 Leetcode | Valid Palindrome II (回文字符串)

Description:Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.Example:Input: “aba”Output: TrueInput: “abca”Output: TrueExplanation: You could delete the character ‘c’.Ideas:In this c

2021-01-29 12:10:38 117

原创 Leetcode | Reverse Vowels of a String (反转字符串中的元音字符)

Description:Write a function that takes a string as input and reverse only the vowels of a string.Attention:Vowels include captial lettersExample:Input: “hello”Output: “holle”Input: “leetcode”Output: “leotcede”Ideas:The first idea in my mind

2021-01-29 12:10:20 116

原创 Leetcode | Sum of Square Numbers (两数平方和)

Description:Given a non-negative integer c, decide whether there’re two integers a and b such that a2 + b2 = c.Example:Input: c = 5Output: trueExplanation: 1 * 1 + 2 * 2 = 5Input: c = 3Output: falseIdeas:We all know that the sqrt of an integ

2021-01-27 23:24:14 180

原创 Leetcode | Two Sum (两数之和)

Description:Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each input would have exactly one solution, and you may not use the same element twice.You can retu

2021-01-27 13:22:47 156 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除