Skip to content

Commit

Permalink
modified: .idea/.name
Browse files Browse the repository at this point in the history
	modified:   .idea/workspace.xml
	modified:   BETA_E_Model_T&T.ipynb
	deleted:    Utils/New_SGD.py
	modified:   Utils/Other.py
	modified:   Utils/README.md
	modified:   Utils/lr_find.py
	modified:   Utils/one_cycle.py
	deleted:    Utils/swap_ema_weights.py
  • Loading branch information
Aydinhamedi committed Mar 24, 2024
1 parent 059cc82 commit 73a0ec5
Show file tree
Hide file tree
Showing 9 changed files with 5,103 additions and 4,898 deletions.
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9,659 changes: 5,084 additions & 4,575 deletions BETA_E_Model_T&T.ipynb

Large diffs are not rendered by default.

128 changes: 0 additions & 128 deletions Utils/New_SGD.py

This file was deleted.

6 changes: 3 additions & 3 deletions Utils/Other.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
from Utils.print_color_V2_NEW import print_Color_V2
from Utils.print_color_V1_OLD import print_Color
import keras.backend as K
from tabulate import tabulate
from numba import cuda
import numpy as np
Expand Down Expand Up @@ -141,9 +140,10 @@ def set_optimizer_attribute(optimizer, attribute, value, verbose: bool = False):
verbose: Whether to print a message if the attribute does not exist.
"""
if hasattr(optimizer, attribute):
K.set_value(getattr(optimizer, attribute), value)
setattr(optimizer, attribute, value)
else:
print(f"The optimizer does not have an attribute named '{attribute}'") if verbose else None
if verbose:
print(f"The optimizer does not have an attribute named '{attribute}'")


def print_optimizer_info(model):
Expand Down
3 changes: 0 additions & 3 deletions Utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

## Timeout_input.py (by Me)

## swap_ema_weights and New_SGD.py (\`**smi**\` copy of keras 3)
- ### github repo used: [keras](https://github.com/keras-team/keras)

## FixedDropout.py (by Me)
For EfficientNet model Example:
```python
Expand Down
13 changes: 5 additions & 8 deletions Utils/lr_find.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import keras
import tempfile

import matplotlib.pyplot as plt
import numpy as np

import tensorflow as tf
from tensorflow import keras
from tqdm.auto import tqdm

K = keras.backend
import keras.src.legacy.backend as K


class Scheduler:
Expand Down Expand Up @@ -59,9 +56,9 @@ class LrFinder:

def __init__(
self,
model: tf.keras.Model,
optimizer: tf.keras.optimizers.Optimizer,
loss_fn: tf.keras.losses.Loss,
model: keras.Model,
optimizer: keras.optimizers.Optimizer,
loss_fn: keras.losses.Loss,
) -> None:
self.lrs = []
self.losses = []
Expand Down
6 changes: 2 additions & 4 deletions Utils/one_cycle.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from tensorflow import keras
import keras
import math
import matplotlib.pyplot as plt

K = keras.backend

import keras.src.legacy.backend as K

class OneCycleLr(keras.callbacks.Callback):
"""
Expand Down
Loading

0 comments on commit 73a0ec5

Please sign in to comment.