-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aba
committed
Nov 20, 2023
1 parent
8d0dd35
commit 5f5c610
Showing
11 changed files
with
524 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from . import hardware, bundle | ||
from .hardware import * | ||
from .bundle import * | ||
from .bundle import * | ||
from .model import * | ||
from .layers import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
from qkeras import QActivation | ||
from tensorflow.keras.layers import Input, Flatten, Add, MaxPooling2D | ||
from tensorflow.keras.layers import Layer, Input, Flatten, Add, MaxPooling2D | ||
import numpy as np | ||
|
||
# class QInput(Input): | ||
# def __init__(self, shape, batch_size, hw, frac_bits, name=None): | ||
|
||
# self.hw = hw | ||
# self.input_frac_bits = input_frac_bits | ||
# super().__init__(shape=shape, name=name) | ||
|
||
# int_bits = hw.X_BITS - self.frac_bits + 1 | ||
|
||
# x = Input(shape=shape, batch_size=batch_size, name=name) | ||
# x = QActivation(f'quantized_bits(bits={hw.X_BITS}, integer={int_bits}, False,True,1)')(x) | ||
|
||
# return x | ||
def QInput(shape, batch_size, hw, int_bits, name=None): | ||
x_raw = Input(shape=shape, batch_size=batch_size, name=name) | ||
x = QActivation(f'quantized_bits({hw.X_BITS},{int_bits},False,True,1)')(x_raw) | ||
x.raw = x_raw | ||
x.hw = hw | ||
return x | ||
|
||
|
||
|
Oops, something went wrong.