Halo

A magic place for coding

0%

AdaBelief

  优化器是训练人工神经网路中一个非常重要的组成部分,优化器的好坏直接决定了训练的精度以及可靠性。我们常用的优化器有SGD、Adam等,最近在NeurIPS 2020中,有一篇关于优化器的paper成为了Spotlight paper,提出了一种新的优化器——**AdaBelief **。实验证明它和Adam一样快,和SGD一样可泛化以及足够稳定,听起来就是当前最优的解法。所以在这篇博客,就来看看这个到底是什么东西。

Read more »

Problem

We are given an array asteroids of integers representing asteroids in a row.

For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed.

Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller one will explode. If both are the same size, both will explode. Two asteroids moving in the same direction will never meet.

Read more »

Python多线程是真的吗

  多线程是我们在编程的时候一定会考虑到的问题,多线程编程能让我们的代码更好地利用计算资源,提高计算速度和效率。Python作为当下最热门的语言,却在多线程编程方面备受质疑。到底python的多线程真的是多线程吗?在这篇博客我将和大家来探讨这个问题。

Read more »

Problem

In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the ith domino. (A domino is a tile with two numbers from 1 to 6 - one on each half of the tile.)

We may rotate the i-th domino, so that A[i] and B[i] swap values.

Return the minimum number of rotations so that all the values in A are the same, or all the values in B are the same.

If it cannot be done, return -1.

Read more »

Problem

You are given an integer array prices where prices[i] is the price of a given stock on the ith day.

Design an algorithm to find the maximum profit. You may complete at most k transactions.

Notice that you may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

Read more »

Problem

All DNA is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T', for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.

Write a function to find all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule.

Read more »