cs230-code-examples
cs230-code-examples copied to clipboard
Code examples in pyTorch and Tensorflow for CS230
When I run this script using the provided sample dataset: python search_hyperparams.py --data_dir data/small --parent_dir experiments/learning_rate It throwed me an error: 
Bumps [tensorflow](https://github.com/tensorflow/tensorflow) from 1.15.0 to 2.7.2. Release notes Sourced from tensorflow's releases. TensorFlow 2.7.2 Release 2.7.2 This releases introduces several vulnerability fixes: Fixes a code injection in saved_model_cli (CVE-2022-29216) Fixes...
Bumps [tensorflow](https://github.com/tensorflow/tensorflow) from 1.15.0 to 2.7.2. Release notes Sourced from tensorflow's releases. TensorFlow 2.7.2 Release 2.7.2 This releases introduces several vulnerability fixes: Fixes a code injection in saved_model_cli (CVE-2022-29216) Fixes...
The Variable API has been deprecated in Pytorch 1.10. From [Pytorch 1.10 documentation](https://pytorch.org/docs/stable/autograd.html?highlight=torch%20autograd): "Autograd automatically supports Tensors with requires_grad set to True Variables are no longer necessary to use autograd...
Hello! I've found a performance issue in input_fn.py: `batch()` should be called before `map()`, which could make your program more efficient. Here is [the tensorflow document](https://tensorflow.google.cn/guide/data_performance?hl=zh_cn#vectorized_mapping) to support it. Detailed...
Hello,[this issue](https://github.com/cs230-stanford/cs230-code-examples/issues/37) shows the reason that I commit this PR. I sincerely wish my PR will help you.And if you think my PR has a little work,Hoping you could merge...
Hello,I found a performance issue in the definition of `input_fn` , cs230-stanford/cs230-code-examples/blob/master/tensorflow/vision/model/input_fn.py, [dataset = (tf.data.Dataset.map](https://github.com/cs230-stanford/cs230-code-examples/blob/478e747b1c8bf57c6e2ce6b7ffd8068fe0287056/tensorflow/vision/model/input_fn.py#L76) was called without **num_parallel_calls**. I think it will increase the efficiency of your program if...
The code in [pytorch/vision/train.py](https://github.com/cs230-stanford/cs230-code-examples/blob/master/pytorch/vision/train.py#L70-L90) and [pytorch/vision/evaluate.py](https://github.com/cs230-stanford/cs230-code-examples/blob/master/pytorch/vision/evaluate.py#L55-L67) describe how to calculate metrics with batches of data. In train.py, since it calculates the metrics once in a while, it doesn't represent the...
https://github.com/cs230-stanford/cs230-code-examples/blob/96ac6fd7dd72831a42f534e65182471230007bee/tensorflow/vision/build_dataset.py#L40 I think we can maybe use `os.path.basename(filename)` instead of `filename.split('/')[-1]` as in windows os the paths to images get a `\\` instead of `/`. Just with this change we...