09 2020 档案
摘要:const person = { name: "wan", age: 28 } type Person = typeof person type PersonKeys = keyof person // "name" | "age" type PersonKTypes = Person[Person
阅读全文
摘要:In Javascript, you know typeof: typeof [] // object typeof "" // string In Typescript it is more smart: const person = { name: "wan", age: 28 } type P
阅读全文
摘要:import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input",
阅读全文
摘要:import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input",
阅读全文
摘要:See the following example: const elem = document.querySelector('.click'); function handleClick(event: Event) { event.preventDefault(); console.log(thi
阅读全文
摘要:Because Javascript has inconsistent way to cleanup the lisenters: removeEventListener(button, "click") clearnTimeout(id) We can implement a contract t
阅读全文
摘要:enum Sizes { Small = "small", Medium = "medium", Large = "large" } let selected: Sizes = Sizes.Samll; function updateSize(size: Sizes): void { selecte
阅读全文
摘要:Let's say we have enum defined as such: export enum WeekDayEnum { sunday = 0, monday, tuseday, wednesday, thursday, friday, saturday, } export type Da
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:StatisticSolution Accuracy (85 + 10) / (1000) = .095 Precision (85) / (85 + 890) = 0.087 Recall There are 85 true positives and 15 false negatives, so
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:
阅读全文
摘要: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
阅读全文
摘要:section img { --aspect-ratio: calc( 4 / 3); --height: 30vmin; --width: calc(var(--height) * var(--aspect-ratio)); height: var(--height); width: var(--
阅读全文
摘要: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
阅读全文
摘要:Gradient checking will assure that our backpropagation works as intended. We can approximate the derivative of our cost function with: epsilon = 1e-4;
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Install: npm i --save joi Example: const schema = Joi.object({ username: Joi.string() .alphanum() .min(3) .max(30) .required(), password: Joi.string()
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:"Backpropagation" is neural-network terminology for minimizing our cost function, just like what we were doing with gradient descent in logistic and l
阅读全文
摘要:Let's first define a few variables that we will need to use:
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:30 -20x1 - 20x2 0 0 1 0 1 1 1 0 1 1 1 0 So NOTx1 AND NOTx2
阅读全文
摘要: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
阅读全文
摘要:Combine X1 & X1 with !X1 & !X2 to get first hidden layer as result. Then hidden layer with X1 OR X2 to get final result.
阅读全文
摘要: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
阅读全文
摘要:const factorial = (n) => (n > 1 ? n * factorial(n - 1) : 1); const memoize = (fn) => { const cache = {}; return (...args) => { const key = JSON.string
阅读全文
摘要:With just a handful of CSS properties, we can create an intrinsically responsive photo gallery using flexbox. This is accomplished by setting our pref
阅读全文
摘要:theta(1) = S(j+1) * (Sj + 1) theta(1) = 4 * (2 + 1) = 4 * 3
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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’
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Returning null will not update state and trigger a component re-render Example: updateMocktail = mocktail => { const newMocktail = mocktail; this.setS
阅读全文