美文网首页
Tips and Tricks

Tips and Tricks

作者: Lobotomy | 来源:发表于2017-08-29 22:35 被阅读0次

算法 (Algorithms)

- to check if only one bit is set:

int n = 16; // 0001 0000
return n & (n - 1) == 0;

Java

- && 比 || 优先级高, 同时使用注意括号

return true || true && false; // true

- Scanner下使用nextInt()后需加一行nextLine()才可继续输入字符串

Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine(); //若无此行,s为上行输入数字之后的回车键
String s = sc.nextLine();
System.out.println(n);
System.out.println(s);

统计 (Statistics)

- sampling with or without replacement

即有放回与无放回的采样

- features and variables are different terms of the same thing

which is, the column.
The row is observation.

Tensorflow

- way of feeding data

There are three other methods of getting data into a TensorFlow program:

  • Feeding: Python code provides the data when running each step.
  • Reading from files: an input pipeline reads the data from files at the beginning of a TensorFlow graph.
  • Preloaded data: a constant or variable in the TensorFlow graph holds all the data (for small datasets).

相关文章

网友评论

      本文标题:Tips and Tricks

      本文链接:https://www.haomeiwen.com/subject/bnwadxtx.html