First sentence of document.
To create a line blank add a
and you will receive a line break!
underscore creates italics asterisks for bold
| from selenium import webdriver | |
| from selenium.webdriver.common.keys import Keys | |
| import time | |
| browser=webdriver.Chrome() | |
| #first tab | |
| browser.execute_script("window.open('about:blank', 'tab1');") | |
| browser.switch_to_window("tab1") |
| {'b': {'args': (), | |
| 'fn': Normal(loc: 0.0, scale: 1.0), | |
| 'name': 'b', | |
| 'type': 'sample', | |
| 'value': tensor(-1.1897, grad_fn=<AddBackward0>)}, | |
| 'b_loc': {'args': (tensor(0.), Real()), | |
| 'fn': <function param.<locals>.fn at 0x127388950>, | |
| 'name': 'b_loc', | |
| 'type': 'param', | |
| 'value': tensor(0., requires_grad=True)}, |
| # Install ipython3 on Mac OS | |
| # check if brew exists | |
| brew | |
| # install brew if necessary | |
| # follow instructions in | |
| # https://brew.sh/ | |
| # Update brew | |
| brew update |
| def factorial(n): | |
| if n == 0: | |
| return 1 | |
| return factorial(n - 1) * n | |
| def factorial_cps(k, n): | |
| if n == 0: |
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # C extensions | |
| *.so | |
| # Distribution / packaging | |
| .Python |
| [0] | |
| Question: | |
| With a given tuple (1,2,3,4,5,6,7,8,9,10), write a program to print the first half values in one line and the last half values in one line. | |
| Hints: | |
| Use [n1:n2] notation to get a slice from a tuple. | |
| [1] |
| import tensorflow as tf | |
| import numpy as np | |
| class LogisticRegressor(object): | |
| def __init__(self, num_attrs, num_labels, threshold=0.8, lr=0.01): | |
| self.attrs = tf.placeholder(tf.float32, [None, num_attrs], name='attrs') | |
| self.labels= tf.placeholder(tf.int32, [None, num_labels], name='labels') |
| import tensorflow as tf | |
| import numpy as np | |
| DropoutWrapper = tf.nn.rnn_cell.DropoutWrapper | |
| class SentimentNetwork(object): | |
| def __init__(self, hdim=25, wdim=25, pdim=25, vocab_size=2000, pos_vocab_size=30, |
| def apply_filter(x, filter_size, emb_dim, max_word_len): | |
| """ | |
| Run convolution operation on x with "filter_size"d filter | |
| Args: | |
| x : sequence to which conv should be applied | |
| filter_size : size of filter | |
| emb_dim : embedding dimensions | |
| max_word_len : maximum length of a word | |
| Returns: | |
| Output of 1D convolution |