09 2020 档案

摘要:const person = { name: "wan", age: 28 } type Person = typeof person type PersonKeys = keyof person // "name" | "age" type PersonKTypes = Person[Person 阅读全文
posted @ 2020-09-30 20:20 Zhentiw 阅读(122) 评论(0) 推荐(0) 编辑
摘要:In Javascript, you know typeof: typeof [] // object typeof "" // string In Typescript it is more smart: const person = { name: "wan", age: 28 } type P 阅读全文
posted @ 2020-09-30 20:11 Zhentiw 阅读(124) 评论(0) 推荐(0) 编辑
摘要:import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input", 阅读全文
posted @ 2020-09-30 18:32 Zhentiw 阅读(164) 评论(0) 推荐(0) 编辑
摘要:import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input", 阅读全文
posted @ 2020-09-30 18:12 Zhentiw 阅读(129) 评论(0) 推荐(0) 编辑
摘要:See the following example: const elem = document.querySelector('.click'); function handleClick(event: Event) { event.preventDefault(); console.log(thi 阅读全文
posted @ 2020-09-30 01:17 Zhentiw 阅读(384) 评论(0) 推荐(0) 编辑
摘要:Because Javascript has inconsistent way to cleanup the lisenters: removeEventListener(button, "click") clearnTimeout(id) We can implement a contract t 阅读全文
posted @ 2020-09-29 19:12 Zhentiw 阅读(141) 评论(0) 推荐(0) 编辑
摘要:enum Sizes { Small = "small", Medium = "medium", Large = "large" } let selected: Sizes = Sizes.Samll; function updateSize(size: Sizes): void { selecte 阅读全文
posted @ 2020-09-29 15:24 Zhentiw 阅读(101) 评论(0) 推荐(0) 编辑
摘要:Let's say we have enum defined as such: export enum WeekDayEnum { sunday = 0, monday, tuseday, wednesday, thursday, friday, saturday, } export type Da 阅读全文
posted @ 2020-09-29 15:13 Zhentiw 阅读(153) 评论(0) 推荐(0) 编辑
摘要:Traversing items of custom data structures, like trees or linked lists, require knowledge of how that data structure is built. That can lead to proble 阅读全文
posted @ 2020-09-27 16:21 Zhentiw 阅读(189) 评论(0) 推荐(0) 编辑
摘要:This learning curve shows high error on the test sets but comparatively low error on training set, so the algorithm is suffering from high variance. T 阅读全文
posted @ 2020-09-27 03:30 Zhentiw 阅读(178) 评论(0) 推荐(0) 编辑
摘要:StatisticSolution Accuracy (85 + 10) / (1000) = .095 Precision (85) / (85 + 890) = 0.087 Recall There are 85 true positives and 15 false negatives, so 阅读全文
posted @ 2020-09-27 03:16 Zhentiw 阅读(250) 评论(0) 推荐(0) 编辑
摘要:Recoil offers several hooks to use for consuming state in React, and this lesson looks at how to choose which hook to use, and what happens when you d 阅读全文
posted @ 2020-09-27 00:55 Zhentiw 阅读(176) 评论(0) 推荐(0) 编辑
摘要:Training an algorithm on a very few number of data points (such as 1, 2 or 3) will easily have 0 errors because we can always find a quadratic curve t 阅读全文
posted @ 2020-09-25 15:29 Zhentiw 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-09-22 18:24 Zhentiw 阅读(91) 评论(0) 推荐(0) 编辑
摘要:In this section we examine the relationship between the degree of the polynomial d and the underfitting or overfitting of our hypothesis. We need to d 阅读全文
posted @ 2020-09-22 15:44 Zhentiw 阅读(288) 评论(0) 推荐(0) 编辑
摘要:Just because a learning algorithm fits a training set well, that does not mean it is a good hypothesis. It could over fit and as a result your predict 阅读全文
posted @ 2020-09-21 23:03 Zhentiw 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-09-16 03:45 Zhentiw 阅读(113) 评论(0) 推荐(0) 编辑
摘要:First, pick a network architecture; choose the layout of your neural network, including how many hidden units in each layer and how many layers in tot 阅读全文
posted @ 2020-09-16 03:32 Zhentiw 阅读(133) 评论(0) 推荐(0) 编辑
摘要:section img { --aspect-ratio: calc( 4 / 3); --height: 30vmin; --width: calc(var(--height) * var(--aspect-ratio)); height: var(--height); width: var(-- 阅读全文
posted @ 2020-09-15 23:42 Zhentiw 阅读(132) 评论(0) 推荐(0) 编辑
摘要:As you can see "Characters" take two params, page & filter. Here use two alias: allChars: characters fullNmae: name. Alias is also useful when you nee 阅读全文
posted @ 2020-09-15 23:32 Zhentiw 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Gradient checking will assure that our backpropagation works as intended. We can approximate the derivative of our cost function with: epsilon = 1e-4; 阅读全文
posted @ 2020-09-15 23:23 Zhentiw 阅读(159) 评论(0) 推荐(0) 编辑
摘要:When consuming asynchronous selectors in Recoil, you're going to need to tell React what to render while the API is fetching its data. One way to solv 阅读全文
posted @ 2020-09-13 22:28 Zhentiw 阅读(271) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we add a Docker configuration to our project. In the Dockerfile we specify the different layers of our Docker image. We use a pretty s 阅读全文
posted @ 2020-09-13 22:19 Zhentiw 阅读(201) 评论(0) 推荐(0) 编辑
摘要:Install: npm i --save joi Example: const schema = Joi.object({ username: Joi.string() .alphanum() .min(3) .max(30) .required(), password: Joi.string() 阅读全文
posted @ 2020-09-13 22:09 Zhentiw 阅读(204) 评论(0) 推荐(0) 编辑
摘要:With neural networks, we are working with sets of matrices: In order to use optimizing functions such as "fminunc()", we will want to "unroll" all the 阅读全文
posted @ 2020-09-13 02:12 Zhentiw 阅读(157) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we use CSS pseudo-elements and the mix-blend-mode property to create a duotone effect for an image. We wrap the image in a container e 阅读全文
posted @ 2020-09-10 16:06 Zhentiw 阅读(137) 评论(0) 推荐(0) 编辑
摘要:"Backpropagation" is neural-network terminology for minimizing our cost function, just like what we were doing with gradient descent in logistic and l 阅读全文
posted @ 2020-09-10 02:58 Zhentiw 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Let's first define a few variables that we will need to use: 阅读全文
posted @ 2020-09-10 02:44 Zhentiw 阅读(145) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we're going to learn how to create Recoil selectors that accept arguments. These are made possible using the selectorFamily utility fu 阅读全文
posted @ 2020-09-09 19:10 Zhentiw 阅读(844) 评论(0) 推荐(0) 编辑
摘要:When page get loaded, browser need to calculate how to render the page even before first pixel get rendered. Also means that for the content which is 阅读全文
posted @ 2020-09-08 18:53 Zhentiw 阅读(355) 评论(0) 推荐(0) 编辑
摘要:30 -20x1 - 20x2 0 0 1 0 1 1 1 0 1 1 1 0 So NOTx1 AND NOTx2 阅读全文
posted @ 2020-09-08 03:36 Zhentiw 阅读(177) 评论(0) 推荐(0) 编辑
摘要:To classify data into multiple classes, we let our hypothesis function return a vector of values. Say we wanted to classify our data into one of four 阅读全文
posted @ 2020-09-07 03:05 Zhentiw 阅读(242) 评论(0) 推荐(0) 编辑
摘要:Combine X1 & X1 with !X1 & !X2 to get first hidden layer as result. Then hidden layer with X1 OR X2 to get final result. 阅读全文
posted @ 2020-09-07 02:53 Zhentiw 阅读(119) 评论(0) 推荐(0) 编辑
摘要:SQL is dynamic enough to handle queries within queries. These inner queries are called subqueries and they can be used in many different sections of a 阅读全文
posted @ 2020-09-07 01:50 Zhentiw 阅读(171) 评论(0) 推荐(0) 编辑
摘要:const factorial = (n) => (n > 1 ? n * factorial(n - 1) : 1); const memoize = (fn) => { const cache = {}; return (...args) => { const key = JSON.string 阅读全文
posted @ 2020-09-06 17:23 Zhentiw 阅读(123) 评论(0) 推荐(0) 编辑
摘要:With just a handful of CSS properties, we can create an intrinsically responsive photo gallery using flexbox. This is accomplished by setting our pref 阅读全文
posted @ 2020-09-05 04:03 Zhentiw 阅读(251) 评论(0) 推荐(0) 编辑
摘要:theta(1) = S(j+1) * (Sj + 1) theta(1) = 4 * (2 + 1) = 4 * 3 阅读全文
posted @ 2020-09-04 01:51 Zhentiw 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Error Boundaries are the way you handle errors with React, and Suspense embraces this completely. Let's take a look at how to handle asynchronous erro 阅读全文
posted @ 2020-09-02 15:00 Zhentiw 阅读(811) 评论(0) 推荐(0) 编辑
摘要:SQL gives us the power to choose what data we pull out of our table. We will use the where clause within our select statement with many operators. The 阅读全文
posted @ 2020-09-02 03:37 Zhentiw 阅读(141) 评论(0) 推荐(0) 编辑
摘要:Today modern browsers added native support for lazy loading images, and we can benefit from it by adding one simple attribute to our img element: <img 阅读全文
posted @ 2020-09-01 22:33 Zhentiw 阅读(143) 评论(0) 推荐(0) 编辑
摘要:React is really good at creating and updating DOM elements, but sometimes you need to work with them yourself. A common use case for this is when you’ 阅读全文
posted @ 2020-09-01 19:05 Zhentiw 阅读(143) 评论(0) 推荐(0) 编辑
摘要:Something that’s important to recognize is that every time you call the state updater function (like the setName function in our component), that will 阅读全文
posted @ 2020-09-01 18:54 Zhentiw 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Sometimes you have some boilerplate for components that would be nice to abstract away slightly with a simple helper function. In this lesson we'll le 阅读全文
posted @ 2020-09-01 15:30 Zhentiw 阅读(127) 评论(0) 推荐(0) 编辑
摘要:Returning null will not update state and trigger a component re-render Example: updateMocktail = mocktail => { const newMocktail = mocktail; this.setS 阅读全文
posted @ 2020-09-01 15:10 Zhentiw 阅读(159) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示